webchat.py 文件源码

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

项目:LalkaChat 作者: DeForce 项目源码 文件源码
def run(self):
        while self.running:
            message = s_queue.get()

            if 'timestamp' not in message:
                message['timestamp'] = datetime.datetime.now().isoformat()

            if message['type'] in HISTORY_TYPES:
                cherrypy.engine.publish('add-history', message)
            elif message['type'] == 'command':
                cherrypy.engine.publish('process-command', message['command'], message)

            if message['type'] == 'system_message' and not self.settings['chat']['keys'].get('show_system_msg', True):
                continue

            log.debug("%s", message)
            self.send_message(message, 'chat')
            self.send_message(message, 'gui')
        log.info("Messaging thread stopping")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号