Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-10-08 16:37:38 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-10-08 16:37:38 (GMT)
commit9bd1bff4d8ab6247e5793c0b78b9bf2581773341 (patch)
tree13a4914f0de789d3c6dd9acf70a273f6d34c9230 /bin
parente29723a33192cb27b1de83fd8e1abd110bbc1433 (diff)
parentb1c4a254adc0573221c0d6661459248fd3c507ef (diff)
Merge branch 'master' of ../datastore2
Conflicts: src/olpc/datastore/backingstore.py src/olpc/datastore/datastore.py src/olpc/datastore/xapianindex.py tests/test_sugar.py
Diffstat (limited to 'bin')
-rwxr-xr-xbin/datastore-service31
1 files changed, 1 insertions, 30 deletions
diff --git a/bin/datastore-service b/bin/datastore-service
index aba7112..850af9d 100755
--- a/bin/datastore-service
+++ b/bin/datastore-service
@@ -4,46 +4,26 @@ import gobject
import dbus.service
import dbus.mainloop.glib
import dbus.glib
-from olpc.datastore import DataStore, backingstore
+from olpc.datastore.datastore import DataStore
from sugar import logger
# Path handling
profile = os.environ.get('SUGAR_PROFILE', 'default')
base_dir = os.path.join(os.path.expanduser('~'), '.sugar', profile)
-repo_dir = os.path.join(base_dir, 'datastore')
-
-# operate from the repo directory
-if not os.path.exists(repo_dir): os.makedirs(repo_dir)
-
log_dir = os.path.join(base_dir, "logs")
if not os.path.exists(log_dir): os.makedirs(log_dir)
-#os.chdir(repo_dir)
-
# setup logger
logger.start('datastore')
-# check for old lockfiles, the rules here are that we can't be
-# connected to a tty. If we are not then in all likelyhood the process
-# was started automatically, which hopefully implies a single instance
-if not sys.stdin.isatty():
- lf = os.path.join(repo_dir, 'fulltext', 'flintlock')
- if os.path.exists(lf):
- logging.warning("Old lock file found -- removing.")
- os.unlink(lf)
-
-
# build the datastore
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
connected = True
ds = DataStore()
-ds.registerBackend(backingstore.FileBackingStore)
-ds.registerBackend(backingstore.InplaceFileBackingStore)
# and run it
-logging.info("Starting Datastore %s" % (repo_dir))
mainloop = gobject.MainLoop()
def handle_disconnect():
@@ -65,11 +45,6 @@ signal.signal(signal.SIGHUP, handle_shutdown)
signal.signal(signal.SIGTERM, handle_shutdown)
def main():
- if '-m' in sys.argv:
- # mount automatically for local testing
- ds.mount(repo_dir)
- ds.complete_indexing()
-
try:
mainloop.run()
except KeyboardInterrupt:
@@ -81,7 +56,3 @@ main()
ds.stop()
-#import hotshot
-#p = hotshot.Profile('hs.prof')
-#p.run('main()')
-