Esempio n. 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)
Esempio n. 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()