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()
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()
def async_sleep(secs): d = defer.Deferred() reactor.callLater(secs, d.callback, None) return d