Skip to content

Commit 4e0452e

Browse files
committed
[scrips/odmlview] Add docstrings
1 parent 29ddc11 commit 4e0452e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

odml/scripts/odml_view.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242

4343

4444
def download_file(repo, filename):
45+
"""
46+
download_file fetches 'filename' from url 'repo' and
47+
saves it in the current directory as file 'filename'.
48+
"""
4549
try:
4650
data = urllib2.urlopen("%s%s" % (repo, filename)).read()
4751
data = data.decode("utf-8")
@@ -54,6 +58,16 @@ def download_file(repo, filename):
5458

5559

5660
def run(port=PORT, extensions=None):
61+
"""
62+
run starts a simple webserver on localhost serving the current directory.
63+
Once started, it will open a tab on the default webbrowser and will continue
64+
to serve until manually stopped.
65+
66+
:param port: server port
67+
:param extensions: dictionary containing additional file extension - mime type
68+
mappings the server should be aware of.
69+
e.g. {'.xml': 'application/xml'}
70+
"""
5771
handler = hs.SimpleHTTPRequestHandler
5872

5973
if extensions:

0 commit comments

Comments
 (0)