Mercurial > templog
changeset 561:54ef7f84487d
actually update values
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 10 Jun 2015 00:10:08 +0800 |
parents | 18e6e830ca26 |
children | 55cae4f27e75 |
files | py/params.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/py/params.py Tue Jun 09 23:39:22 2015 +0800 +++ b/py/params.py Wed Jun 10 00:10:08 2015 +0800 @@ -106,7 +106,7 @@ dir = os.path.dirname(config.PARAMS_FILE) try: t = tempfile.NamedTemporaryFile(prefix='config', - mode='w+t', + mode='w+t', # NamedTemporaryFile is binary by default dir = dir, delete = False) @@ -116,10 +116,14 @@ t.close() os.rename(name, config.PARAMS_FILE) - return True except Exception as e: EX("Problem: %s" % e) return False + self.update(params) + L("Received parameters") + L(self.save_string()) + return True + def save_string(self): return json.dumps(self, sort_keys=True, indent=4)