Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-13 03:14:21 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-13 03:14:21 (GMT)
commitfded7518d44197dd109cdeb891a73bcf7dd55613 (patch)
tree12787d84e7e15c4ddadacde009e292b97868dcb2 /bin
parent6180ddc862188ba3728b43f8f4b74f73b077f3da (diff)
sample client dbus interface verified
Diffstat (limited to 'bin')
-rwxr-xr-xbin/datastore-service6
-rwxr-xr-xbin/sample-client.py15
2 files changed, 6 insertions, 15 deletions
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)