From: Tomas Gavenciak Date: Fri, 24 Sep 2010 14:00:27 +0000 (+0200) Subject: Added unfix(), corrected fix() X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=11ea8e933d3a8d827da650898c277424e64f2040;p=moe.git Added unfix(), corrected fix() --- diff --git a/t/moe/config.py b/t/moe/config.py index abc8269..e6ce045 100644 --- a/t/moe/config.py +++ b/t/moe/config.py @@ -110,7 +110,14 @@ class ConfigTree(object): if isinstance(keys, types.StringTypes): keys = [keys] for key in keys: - self.lookup(key, create=True).fix() + self.lookup(key, create=False).fix() + + def unfix(self, keys): + "Unfix value of variable or list of variables. Unfixing undefined variable raises `UndefinedError`." + if isinstance(keys, types.StringTypes): + keys = [keys] + for key in keys: + self.lookup(key, create=False).unfix() def remove(self, parsed): """Given a list [(varname, `Operation`)] as returned by `parse` or `parse_file`,