def start(data, load): db.init('demo', data, load=load, create=setup, host='localhost') auth = db.authenticator() server = xmpp.Server({ 'plugins': [QueryServer], 'auth': auth, 'jid': auth.host() }) print 'Waiting for clients...' xmpp.start([xmpp.TCPServer(server).bind('127.0.0.1', 5222)])
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, )