manager.py 文件源码

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

项目:PyPlanet 作者: PyPlanet 项目源码 文件源码
def _on_change(self, *args, **kwargs):
        # Making sure we set the settings + variables.
        if len(self._next_settings_update.keys()) > 0:
            logger.debug('Setting mode settings right now!')
            try:
                await self.update_settings(self._next_settings_update)
            except Exception as e:
                logging.error('Can\'t set the script mode settings! Error: {}'.format(str(e)))
            self._next_settings_update = dict()
        if len(self._next_variables_update.keys()) > 0:
            logger.debug('Setting mode variables right now!')
            try:
                await self.update_variables(self._next_variables_update)
            except Exception as e:
                logging.error('Can\'t set the script mode variables! Error: {}'.format(str(e)))
            self._next_variables_update = dict()

        # Make sure we send to the signal when mode is been changed.
        if self._current_script != self._next_script:
            await script_mode_changed.send_robust({
                'unloaded_script': self._current_script, 'loaded_script': self._next_script
            })

        await self.get_current_script(refresh=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号