Beispiel #1
0
def main(argv):
    log.init()
    log.logTwisted()
    log.adaptStandardLogging('paisley', 'paisley', None)

    # get twisted logging in our logging
    log.logTwisted()

    # use observer for standard logging paisley uses
    from twisted.python import log as tplog
    observer = tplog.PythonLoggingObserver()
    observer.start()

    # make sure argv, coming from the command line, is converted to
    # unicode
    argv = [a.decode('utf-8') for a in argv]

    c = GTD()

    log.debug('main', 'invoking parse')

    from twisted.web import error

    try:
        ret = c.parse(argv)
        log.debug('main', 'invoked parse, ret %r' % ret)
    except command.CommandExited, e:
        ret = e.status
        if ret != 0:
            sys.stderr.write('mushin: error: %s\n' % e.output)
Beispiel #2
0
def main(argv):
    from mushin.common import log
    log.init()
    log.debug('maemo', 'main')

    from twisted.internet import gtk2reactor
    gtk2reactor.install()
    from twisted.internet import reactor

    # set paisley to non-strict since we only have simplejson on maemo
    from mushin.extern.paisley import pjson

    assert not pjson.STRICT

    log.logTwisted()

    reactor.callWhenRunning(start)

    reactor.run()
Beispiel #3
0
        print 'Duration:', t.time
        print 'Recurrence:', t.recurrence
        print '% complete:', t.complete

        window.destroy()

    new = False
    if len(sys.argv) > 1:
        new = True

    window = NewWindow(new)

    window.add_contexts(['hack', 'shop', 'work', 'home'])
    window.add_projects(['mushin', 'moap', 'mach'])
    window.add_statuses(['next', ])
    window.loaded()

    if not new:
        t = OldThing()
        window.add_thing(t)

    window.connect('done', done_cb)
    window.connect('destroy', lambda _: gtk.main_quit())

    window.show_all()

if __name__ == "__main__":
    log.init()
    main()
    gtk.main()