4 if value.startswith('[') and not value.endswith(']'):
9 return eval(value) # good enough for now
12 def __init__(self, fn):
13 self.text = open(fn, 'r').read()
14 lines = filter(lambda l: not l.startswith("#") and not l.strip()=='', self.text.splitlines())
24 elif l.strip().endswith('{'):
25 name = l.strip()[:-1].strip()
31 key, value = re.search(r'\t*(\S*) = (.*?)(\s*# .*)?$', l).groups()[0:2]
32 if not complete(value):
35 node[key] = interpret(value)
37 value += re.search(r'\t*(.*?)( *# .*)?$', l).group(0).strip()
39 node[key] = interpret(value)
44 pprint.pprint(Metadata('xenvg-backup').d)