コード例 #1
0
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)
コード例 #2
0
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)
コード例 #3
0
 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)
コード例 #4
0
 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)