diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-07-25 15:13:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-07-25 16:57:24 -0400 |
commit | bbb6cb5fe6a61aa0975dcd9df11f9f648f6abba2 (patch) | |
tree | c97f164ecc7811ef3d6ba07d51a8c05a695d222d /lib/thandy/ServerCLI.py | |
parent | 5f2d07ce78e6443592f84a803fe2adced49ada39 (diff) |
More unit tests and documentation for the Thandy code
Diffstat (limited to 'lib/thandy/ServerCLI.py')
-rw-r--r-- | lib/thandy/ServerCLI.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/thandy/ServerCLI.py b/lib/thandy/ServerCLI.py index 9212846..4b6c1a6 100644 --- a/lib/thandy/ServerCLI.py +++ b/lib/thandy/ServerCLI.py @@ -15,6 +15,9 @@ def tstamp(): return time.strftime("%Y%m%d_%H%M%S", time.localtime()) def snarf(fname): + """Return a string containing the binary contents of the file named + "fname." + """ f = open(fname, 'rb') try: return f.read() @@ -22,6 +25,9 @@ def snarf(fname): f.close() def snarfObj(fname): + """Return a 2-tuple of (object, len), where the object stored in json + format in the file 'fname', and len is that file's length. + """ f = open(fname, 'r') try: length = os.fstat(f.fileno()).st_size |