Manager.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:PokeAlarm 作者: PokeAlarm 项目源码 文件源码
def setup_in_process(self):
        # Set up signal handlers for graceful exit
        gevent.signal(gevent.signal.SIGINT, self.stop)
        gevent.signal(gevent.signal.SIGTERM, self.stop)

        # Update config
        config['TIMEZONE'] = self.__timezone
        config['API_KEY'] = self.__google_key
        config['UNITS'] = self.__units
        config['DEBUG'] = self.__debug
        config['ROOT_PATH'] = os.path.abspath("{}/..".format(os.path.dirname(__file__)))

        # Hush some new loggers
        logging.getLogger('requests').setLevel(logging.WARNING)
        logging.getLogger('urllib3').setLevel(logging.WARNING)

        if config['DEBUG'] is True:
            logging.getLogger().setLevel(logging.DEBUG)

        # Conect the alarms and send the start up message
        for alarm in self.__alarms:
            alarm.connect()
            alarm.startup_message()

    # Main event handler loop
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号