Skip to content

Commit 75959b1

Browse files
committed
[scripts/odmlview] Update docstring
1 parent eb990c7 commit 75959b1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

odml/scripts/odml_view.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
"""odmlView
1+
"""odmlview
2+
3+
odmlview sets up a minimal webserver to view odml files saved in the
4+
XML format via the webbrowser. After it started, the webserver will
5+
open a new tab in the default webbrowser and display the content of
6+
the directory the server was started from. odML files can then be
7+
viewed from there.
8+
To properly render XML, an odML file may contain the element
9+
'<?xml-stylesheet type="text/xsl" href="odmlTerms.xsl"?>' where the
10+
'odmlTerms.xsl' stylesheet should reside in the same directory as the
11+
odML file to be rendered. By using the '--fetch' flag the latest version
12+
of this stylesheet will be downloaded from 'templates.g-node.org' to
13+
the current directory when starting up the service.
214
3-
odmlView sets up a minimal webserver and serves
4-
and renders odml files locally from the directory
5-
the server is started in.
6-
7-
Usage: odmlView [-d DIRECTORY] [-p PORT]
815
Usage: odmlview [-p PORT] [--fetch]
916
1017
Options:
11-
-p PORT Port the server will use.
12-
Default is port 8000.
18+
-p PORT Port the server will use. Default: 8000
1319
--fetch Fetch latest stylesheet from templates.g-node.org
1420
to current directory
1521
-h --help Show this screen
@@ -57,6 +63,7 @@ def run(port=PORT):
5763
with socketserver.TCPServer(server_address, handler) as httpd:
5864
webbrowser.open_new_tab('http://localhost:%s' % port)
5965
try:
66+
print("You can end the server by pressing Ctrl+C")
6067
httpd.serve_forever()
6168
except KeyboardInterrupt:
6269
print("Received Keyboard interrupt, shutting down")

0 commit comments

Comments
 (0)