def main(data, expr): folder = os.path.dirname(data) db.init('demo', 'fsdir:%s' % data, load='yaml:%s' % folder) print 'Result of %r:' % expr result = db.query(expr) if isinstance(result, tuple): for seq in result: for item in seq: print ' %r' % (item,) else: for item in result: print ' %r' % (item,)
def main(data, expr): folder = os.path.dirname(data) db.init('demo', 'fsdir:%s' % data, load='yaml:%s' % folder) print 'Result of %r:' % expr result = db.query(expr) if isinstance(result, tuple): for seq in result: for item in seq: print ' %r' % (item, ) else: for item in result: print ' %r' % (item, )
def get_item(self, iq, query): return self._dumps(iq, db.query(query, self.root))