|
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. |
2 | 14 |
|
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] |
8 | 15 | Usage: odmlview [-p PORT] [--fetch] |
9 | 16 |
|
10 | 17 | Options: |
11 | | - -p PORT Port the server will use. |
12 | | - Default is port 8000. |
| 18 | + -p PORT Port the server will use. Default: 8000 |
13 | 19 | --fetch Fetch latest stylesheet from templates.g-node.org |
14 | 20 | to current directory |
15 | 21 | -h --help Show this screen |
@@ -57,6 +63,7 @@ def run(port=PORT): |
57 | 63 | with socketserver.TCPServer(server_address, handler) as httpd: |
58 | 64 | webbrowser.open_new_tab('http://localhost:%s' % port) |
59 | 65 | try: |
| 66 | + print("You can end the server by pressing Ctrl+C") |
60 | 67 | httpd.serve_forever() |
61 | 68 | except KeyboardInterrupt: |
62 | 69 | print("Received Keyboard interrupt, shutting down") |
|
0 commit comments