qweechat/qweechat/debug.py
Sébastien Helleu 77df9d06f7 Code refactoring, fix setup.py
All changes:
- full PEP8 compliance
- move sources from src/qweechat/ to qweechat/
- move data from data/icons/ to qweechat/data/icons/
- sources validated with PEP8
- use setuptools in setup.py, fix path of data files
2014-05-08 17:40:31 +02:00

50 lines
1.5 KiB
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# debug.py - debug window
#
# Copyright (C) 2011-2014 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
#
# QWeeChat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# QWeeChat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with QWeeChat. If not, see <http://www.gnu.org/licenses/>.
#
import qt_compat
QtGui = qt_compat.import_module('QtGui')
from chat import ChatTextEdit
from input import InputLineEdit
class DebugDialog(QtGui.QDialog):
"""Debug dialog."""
def __init__(self, *args):
QtGui.QDialog.__init__(*(self,) + args)
self.resize(640, 480)
self.setWindowTitle('Debug console')
self.chat = ChatTextEdit(debug=True)
self.input = InputLineEdit(self.chat)
vbox = QtGui.QVBoxLayout()
vbox.addWidget(self.chat)
vbox.addWidget(self.input)
self.setLayout(vbox)
self.show()
def display_lines(self, lines):
for line in lines:
self.chat.display(*line[0], **line[1])