Skip to content

Commit afd60bd

Browse files
committed
[scripts/odmlview] Add fetch stylesheet docopt
1 parent 7a2c6e9 commit afd60bd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

odml/scripts/odml_view.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
the server is started in.
66
77
Usage: odmlView [-d DIRECTORY] [-p PORT]
8+
Usage: odmlview [-p PORT] [--fetch]
89
910
Options:
1011
-p PORT Port the server will use.
1112
Default is port 8000.
12-
-h --help Show this screen.
13-
--version Show version.
13+
--fetch Fetch latest stylesheet from templates.g-node.org
14+
to current directory
15+
-h --help Show this screen
16+
--version Show version
1417
"""
1518

1619
import http.server as hs
@@ -57,6 +60,10 @@ def run(port=PORT):
5760
def main(args=None):
5861
parser = docopt(__doc__, argv=args, version="0.1.0")
5962

63+
# Fetch stylesheet
64+
if parser['--fetch'] and not os.path.exists(STYLESHEET):
65+
fetch_stylesheet()
66+
6067
server_port = int(parser['-p']) if parser['-p'] else PORT
6168

6269
run(server_port)

0 commit comments

Comments
 (0)