class App(RestartingGreenlet): def __init__(self, SLEEP=SLEEP, LIVE=False): RestartingGreenlet.__init__(self, SLEEP=SLEEP, LIVE=LIVE) self.LIVE = LIVE # Tweet only if Live self.SLEEP = SLEEP # Sleep time after each tick self.app = ELESApp(LIVE, MetroEscalatorKeys, MetroElevatorKeys) def _run(self): while True: try: self.app.tick() except Exception as e: import traceback logger.error('ElevatorApp caught Exception: %s\n' % (str(e))) tb = traceback.format_exc() logger.error('Traceback:\n%s\n\n' % tb) logger.info("sleeping...") gevent.sleep(self.SLEEP)
class App(RestartingGreenlet): def __init__(self, SLEEP=SLEEP, LIVE=False): RestartingGreenlet.__init__(self, SLEEP=SLEEP, LIVE=LIVE) self.LIVE = LIVE # Tweet only if Live self.SLEEP = SLEEP # Sleep time after each tick self.app = ELESApp(LIVE, MetroEscalatorKeys, MetroElevatorKeys) def _run(self): while True: try: self.app.tick() except Exception as e: import traceback logger.error('ElevatorApp caught Exception: %s\n'%(str(e))) tb = traceback.format_exc() logger.error('Traceback:\n%s\n\n'%tb) logger.info("sleeping...") gevent.sleep(self.SLEEP)
def __init__(self, SLEEP=SLEEP, LIVE=False): RestartingGreenlet.__init__(self, SLEEP=SLEEP, LIVE=LIVE) self.LIVE = LIVE # Tweet only if Live self.SLEEP = SLEEP # Sleep time after each tick self.app = ELESApp(LIVE, MetroEscalatorKeys, MetroElevatorKeys)