def __init__(self, parent = None):
path = os.path.dirname(ui.__file__)
# chat
self.message_window_path = os.path.join(path, "message_window.ui")
self.chat_main_path = os.path.join(path, "chat_dialog.ui")
self.chat_add_topic_path = os.path.join(path, "chat_add_topic.ui")
self.chat_img_viewer_path = os.path.join(path, "chat_img_viewer.ui")
# moduls
self.db_studio = db.studio()
self.db_artist = db.artist()
self.db_task = db.task()
self.db_log = db.log()
self.db_chat = db.chat()
# get data
home_dir = os.path.expanduser('~')
json_path = os.path.normpath(os.path.join(home_dir, '.blend_chat.json'))
with open(json_path, 'r') as read:
data_dict = json.load(read)
self.chat_status = 'user'
self.current_task = data_dict['current_task']
self.current_user = data_dict['current_user']
self.current_project = data_dict['current_project']
print(data_dict)
# create widget
QtGui.QMainWindow.__init__(self, parent)
self.setWindowTitle('Chat Message Window')
self.textBox = QtGui.QTextEdit(parent = self)
self.textBox.setReadOnly(True)
self.setCentralWidget(self.textBox)
'''
# test text
text = self.textBox.toPlainText()
text = text + '\n' + '>>> ' + 'text.text'
self.textBox.setPlainText(text)
'''
self.run_chat_ui()
lineyka_chat_run.py 文件源码
python
阅读 13
收藏 0
点赞 0
评论 0
评论列表
文章目录