Exemplo n.º 1
0
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,)
Exemplo n.º 2
0
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, )
Exemplo n.º 3
0
 def get_item(self, iq, query):
     return self._dumps(iq, db.query(query, self.root))