From 11ea8e933d3a8d827da650898c277424e64f2040 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Fri, 24 Sep 2010 16:00:27 +0200 Subject: [PATCH] Added unfix(), corrected fix() --- t/moe/config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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`, -- 2.39.2