Esempio n. 1
0
def main():
    logging.basicConfig()
    log = logging.getLogger()
    log.setLevel(10)
    DEBUGLEVEL.value = 99

    creds, query = sys.argv[1:3]
    hosts = sys.argv[3:]

    def stop(result):
        print result
        reactor.stop()
    def later():
        d = defer.DeferredList(
            [doOneDevice(creds, query, h) for h in hosts]
            )
        d.addBoth(stop)
    reactor.callLater(1, later)
    reactor.run()
Esempio n. 2
0
def main():
    logging.basicConfig()
    log = logging.getLogger()
    log.setLevel(10)
    DEBUGLEVEL.value = 99

    creds, query = sys.argv[1:3]
    hosts = sys.argv[3:]

    def stop(result):
        print result
        reactor.stop()

    def later():
        d = defer.DeferredList([doOneDevice(creds, query, h) for h in hosts])
        d.addBoth(stop)

    reactor.callLater(1, later)
    reactor.run()
Esempio n. 3
0
def async_sleep(secs):
    d = defer.Deferred()
    reactor.callLater(secs, d.callback, None)
    return d
Esempio n. 4
0
def async_sleep(secs):
    d = defer.Deferred()
    reactor.callLater(secs, d.callback, None)
    return d