Esempio n. 1
0
def main():
    import sys

    if sys.platform == "linux2" and "-nopairing" not in sys.argv:
        from pair import main

        reactor.callWhenRunning(main)
    log.startLogging(sys.stdout)
    if len(sys.argv) > 1:
        jmain(int(sys.argv[1]))
    else:
        jmain()
    reactor.run()
Esempio n. 2
0
def main():
    droid.log("Starting server")
    l = jmain(port=0)
    portnumber = int(droid.startEventDispatcher())
    sockl = EventSocket(("127.0.0.1", portnumber))
    reactor.callWhenRunning(start_browser, listener=l)
    reactor.run()
Esempio n. 3
0
def main():
    import sys
    if sys.platform == "linux2":
        from pair import main
        reactor.callWhenRunning(main)
    log.startLogging(sys.stdout)
    nobrowser = "--nobrowser" in sys.argv
    if nobrowser:
        sys.argv.remove("--nobrowser")
    if len(sys.argv) > 1:
        jmain(int(sys.argv[1]))
    else:
        jmain()
    if browser_ready() and not nobrowser:
        import webbrowser
        reactor.callLater(1, startbrowser)
    reactor.run()
Esempio n. 4
0
File: main.py Progetto: ygl-rg/AIRi
def main():
    import sys
    if sys.platform == "linux2":
        from pair import main
        reactor.callWhenRunning(main)
    log.startLogging(sys.stdout)
    nobrowser = "--nobrowser" in sys.argv
    if nobrowser:
        sys.argv.remove("--nobrowser")
    if len(sys.argv) > 1:
        jmain(int(sys.argv[1]))
    else:
        jmain()
    if browser_ready() and not nobrowser:
        import webbrowser
        reactor.callLater(1, startbrowser)
    reactor.run()
Esempio n. 5
0
def main():
    droid.log("Checking if bluetooth is available")
    if not droid.checkBluetoothState():
        droid.toggleBluetoothState(True, True)
        if not droid.checkBluetoothState():
            droid.makeToast("I can't work if you don't enable Bluetooth")
            time.sleep(1)
            sys.exit(1)
    from airi.jinja import main as jmain
    from airi.stream import MultiPartStream
    droid.log("Starting server")
    l = jmain(port=0)
    portnumber = int(droid.startEventDispatcher())
    sockl = EventSocket(('127.0.0.1', portnumber))
    reactor.callWhenRunning(start_browser, listener=l)
    reactor.run()
    droid.log("Reactor stopped")
    droid.airiRemoveNotification()