- def parse(self, s, source=None, level=0):
- """Parse `s` (stream/string) into the tree, see `moe.confparser.ConfigParser` for details."""
+ def remove(self, parsed):
+ """Given a list [(varname, `Operation`)] as returned by `parse` or `parse_file`,
+ removes the operations from the respective variables config tree.
+ Variables/operations not present int the tree raise ValueError.
+ """
+ for vname, o in parsed:
+ v = self.lookup(vname, create = True)
+ v.remove_operation(o)
+
+ def parse(self, s, source=None, level=0, proxy=True):
+ """Parse `s` (stream/string) into the tree, see `moe.config_parser.ConfigParser` for details.
+ Returns list of parset operations: [(varname, `Operation`)].
+ By default returns a proxy list-like object that can be used in "with" constructs:
+
+ with config.parse("TEST='1'"):
+ print config['TEST']
+ raise StupidError
+ """