diff py/params.py @ 160:256505f98c4d

uploader works
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Jan 2013 22:37:33 +0800
parents 6d799bee3508
children d73077e8cd67
line wrap: on
line diff
--- a/py/params.py	Thu Jan 03 22:35:54 2013 +0800
+++ b/py/params.py	Thu Jan 03 22:37:33 2013 +0800
@@ -2,6 +2,7 @@
 import collections
 import json
 import signal
+import StringIO
 
 import gevent
 
@@ -48,6 +49,10 @@
                 raise self.Error("Unknown parameter %s=%s in file '%s'" % (str(k), str(u[k]), getattr(f, 'name', '???')))
         self.update(u)
 
+        L("Loaded parameters")
+        L(self.save_string())
+
+
     def save(self, f = None):
         if not f:
             f = file(config.PARAMS_FILE, 'w')
@@ -55,9 +60,14 @@
         f.write('\n')
         f.flush()
 
+    def save_string(self):
+        s = StringIO.StringIO()
+        self.save(s)
+        return s.getvalue()
+
     def reload_signal(self):
         try:
             self.load()
-            L("Reloaded params")
+            L("Reloaded.")
         except self.Error, e:
             W("Problem reloading: %s" % str(e))