#!/usr/bin/python
# nicked off gwibber

import gobject, dbus
from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default=True)
loop = gobject.MainLoop()

if "org.gnome.Hamster" in dbus.SessionBus().list_names():
    print "Found hamster-service already running, exiting"
    quit()


if __name__ == '__main__':
    from hamster.lib import i18n
    i18n.setup_i18n()

    from hamster import db
    print "hamster-service up"

    storage = db.Storage(loop)
    loop.run()
