> def default(self, node, **kw): > for child in node.getChildNodes(): > return self.visit(child, **kw) > > visitExpression = default
I'm not sure I grok this part. It leads to unexpected results: >>> safe_dict("""gid = 'FPS', type = 'Label', pos = [0, 20], text = 'FPS', text2 = 'more text without quotes', fmtline = "@VALUE @SIGNAL", signals = [('FPS',None), ('FPS2', 'something')], danger = 2+2""") {'text2': 'more text without quotes', 'danger': 2, 'fmtline': '@VALUE @SIGNAL', 'text': 'FPS', 'pos': [0, 20], 'signals': [('FPS', None), ('FPS2', 'something')], 'gid': 'FPS', 'type': 'Label'} >>> safe_dict("""gid = 'FPS', type = 'Label', pos = [0, 20], text = 'FPS', text2 = 'more text without quotes', fmtline = "@VALUE @SIGNAL", signals = [('FPS',None), ('FPS2', 'something')], danger = foo()""") {'text2': 'more text without quotes', 'danger': None, 'fmtline': '@VALUE @SIGNAL', 'text': 'FPS', 'pos': [0, 20], 'signals': [('FPS', None), ('FPS2', 'something')], 'gid': 'FPS', 'type': 'Label'} -- http://mail.python.org/mailman/listinfo/python-list