From bbb6cb5fe6a61aa0975dcd9df11f9f648f6abba2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 25 Jul 2010 15:13:04 -0400 Subject: More unit tests and documentation for the Thandy code --- lib/thandy/util.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/thandy/util.py') diff --git a/lib/thandy/util.py b/lib/thandy/util.py index 90f251f..29c7b87 100644 --- a/lib/thandy/util.py +++ b/lib/thandy/util.py @@ -19,6 +19,11 @@ import thandy.master_keys _jsonModule = None def importJSON(): + """Load and return the json module. + + When everybody has Python 2.6 or later, we can just replace this with + 'import json; return json' + """ global _jsonModule if _jsonModule is not None: return _jsonModule @@ -200,6 +205,7 @@ def getRegistryValue(keyname): _controlLog = logging.getLogger("thandy-ctrl") def formatLogString(s): + """DOCDOC""" s = '"%s"' % re.sub(r'(["\\])', r'\\\1', s) s = s.replace("\n", "\\n") return s -- cgit v1.2.3