Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
aa
indexalist
Commits
874ff5c7
Commit
874ff5c7
authored
Dec 18, 2020
by
Michael Murtaugh
Browse files
smake!
parent
e504d77e
Changes
1
Hide whitespace changes
Inline
Side-by-side
indexalist/smake.py
0 → 100644
View file @
874ff5c7
#!/usr/bin/env python3
import
sys
,
subprocess
,
os
def
main
(
args
):
datapath
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"data"
)
sconstruct_path
=
os
.
path
.
join
(
datapath
,
"templates"
,
"Sconstruct.py"
)
template_path
=
os
.
path
.
join
(
datapath
,
"templates"
,
"index-scons.html"
)
env
=
os
.
environ
.
copy
()
env
[
'scons-template'
]
=
template_path
p
=
subprocess
.
run
([
"scons"
,
"-f"
,
sconstruct_path
],
env
=
env
)
def
add_subparser
(
subparsers
):
p
=
subparsers
.
add_parser
(
'smake'
,
help
=
'Use scons to make directory indexes'
)
# p.add_argument("path")
p
.
set_defaults
(
func
=
main
)
if
__name__
==
"__main__"
:
from
argparse
import
ArgumentParser
p
=
argparse
.
ArgumentParser
(
""
)
subparsers
=
p
.
add_subparsers
(
help
=
"subcommands"
)
add_subparser
(
subparsers
)
main
(
p
.
parse_args
(
args
=
([
"smake"
]
+
sys
.
argv
[
1
:])))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment