From fded7518d44197dd109cdeb891a73bcf7dd55613 Mon Sep 17 00:00:00 2001 From: Benjamin Saller Date: Fri, 13 Jul 2007 03:14:21 +0000 Subject: sample client dbus interface verified --- (limited to 'bin') diff --git a/bin/datastore-service b/bin/datastore-service index b21e529..532516b 100755 --- a/bin/datastore-service +++ b/bin/datastore-service @@ -4,7 +4,6 @@ import gobject import dbus.service import dbus.mainloop.glib from olpc.datastore import DataStore, DS_LOG_CHANNEL, backingstore -from olpc.datastore.indexer import INDEX_SERVICE, INDEX_OBJECT_PATH import logging SYNC_INDEX = True @@ -32,8 +31,6 @@ logging.basicConfig(level=logging.DEBUG, filename = filename, ) # disable subsystem logging except where critical -logging.getLogger('sqlalchemy').setLevel(logging.CRITICAL) -logging.getLogger('lemur').setLevel(logging.CRITICAL) logger = logging.getLogger(DS_LOG_CHANNEL) # check for old lockfiles, the rules here are that we can't be @@ -68,9 +65,6 @@ signal.signal(signal.SIGHUP, handle_shutdown) signal.signal(signal.SIGTERM, handle_shutdown) def main(): - if SYNC_INDEX is False: - indexer = bus.get_object(INDEX_SERVICE, INDEX_OBJECT_PATH) - try: mainloop.run() except KeyboardInterrupt: ds.stop() diff --git a/bin/sample-client.py b/bin/sample-client.py index bd609a7..7dc1501 100755 --- a/bin/sample-client.py +++ b/bin/sample-client.py @@ -2,7 +2,6 @@ from ore.main import Application import dbus import os -import time def main(): bus = dbus.SessionBus() @@ -12,13 +11,8 @@ def main(): uid = datastore.create(dict(title="from dbus", author="Benjamin"), os.path.abspath('tests/test.pdf')) print "created uid", uid - - #for u in datastore.find()[0]: - # datastore.delete(u['uid']) - #return - # let the async indexer run - time.sleep(1.2) - #import pdb;pdb.set_trace() + datastore.complete_indexing() + print "find", datastore.find(dict(author="Benjamin", title="from")) res, count = datastore.find(dict(fulltext="peek")) if not res: @@ -33,11 +27,14 @@ def main(): print datastore.find(dict(fulltext="inside")) datastore.update(uid, dict(title="another updated title", mime_type="application/vnd.oasis.opendocument.text"), os.path.abspath('tests/test.odt')) print datastore.find(dict(fulltext="amazed")) + + datastore.complete_indexing() datastore.get_properties(uid) - print "title in fulltext", datastore.find(dict(fulltext="another")) + print "title in fulltext", datastore.find(dict(title="another")) datastore.delete(uid) + datastore.complete_indexing() if __name__ == '__main__': #a = Application("client", main) -- cgit v0.9.1