# Path: XulDebugTool/utils/ConsoleStreamEmittor.py
# class ConsoleEmittor(QObject):
#     textWritten = pyqtSignal(str)
# 
#     def write(self, text):
#         self.textWritten.emit(str(text))
# 
# Path: XulDebugTool/utils/IconTool.py
# class IconTool(object):
#     def __init__(self):
#         super().__init__()
# 
#     def buildQIcon(iconName):
#         return QIcon(os.path.join('..', 'resources', 'images', iconName))
# 
#     def buildQPixmap(pixmapName):
#         return QPixmap(os.path.join('..', 'resources', 'images', pixmapName))


import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QTextCursor
from PyQt5.QtWidgets import QMainWindow, QAction, \
    QSplitter, QApplication, QWidget, QHBoxLayout, QComboBox, QPushButton, \
    QLineEdit, QSizePolicy, QVBoxLayout, QTextBrowser
from XulDebugTool.utils.ConsoleStreamEmittor import ConsoleEmittor
from XulDebugTool.utils.IconTool import IconTool
        self.layoutLeft.setAlignment(Qt.AlignTop)
        self.layoutLeft.setSpacing(1)
        self.layoutLeft.addWidget(self.clearButton)
        self.layoutLeft.setContentsMargins(4, 0, 0, 0)
        self.leftWiget = QWidget()
        self.leftWiget.setAutoFillBackground(True)
        self.leftWiget.setLayout(self.layoutLeft)
        self.leftWiget.setFixedWidth(22)

        # 右
        self.textEdit = QTextBrowser()
        self.textEdit.setOpenLinks(True)
        self.textEdit.setOpenExternalLinks(True)
        self.textEdit.setReadOnly(True)

        self.rightWiget = QWidget()
        self.rightWiget.setAutoFillBackground(True)
        self.rightWiget.setFixedWidth(15)

        self.messageSplitter = QSplitter(Qt.Horizontal)
        self.messageSplitter.addWidget(self.leftWiget)
        self.messageSplitter.addWidget(self.textEdit)
        self.messageSplitter.addWidget(self.rightWiget)

        self.mainSplitter = QSplitter(Qt.Vertical)
        self.mainSplitter.addWidget(self.functionTabWiget)
        self.mainSplitter.addWidget(self.messageSplitter)
        self.setCentralWidget(self.mainSplitter)

        # 重定向输出

# Path: XulDebugTool/utils/ConsoleStreamEmittor.py
# class ConsoleEmittor(QObject):
#     textWritten = pyqtSignal(str)
# 
#     def write(self, text):
#         self.textWritten.emit(str(text))
# 
# Path: XulDebugTool/utils/IconTool.py
# class IconTool(object):
#     def __init__(self):
#         super().__init__()
# 
#     def buildQIcon(iconName):
#         return QIcon(os.path.join('..', 'resources', 'images', iconName))
# 
#     def buildQPixmap(pixmapName):
#         return QPixmap(os.path.join('..', 'resources', 'images', pixmapName))


# Path: XulDebugTool/ui/widget/ConsoleView.py
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QTextCursor
from PyQt5.QtWidgets import QMainWindow, QAction, \
    QSplitter, QApplication, QWidget, QHBoxLayout, QComboBox, QPushButton, \
    QLineEdit, QSizePolicy, QVBoxLayout, QTextBrowser
from XulDebugTool.utils.ConsoleStreamEmittor import ConsoleEmittor
from XulDebugTool.utils.IconTool import IconTool

        self.layoutLeft.setAlignment(Qt.AlignTop)
        self.layoutLeft.setSpacing(1)
        self.layoutLeft.addWidget(self.clearButton)
        self.layoutLeft.setContentsMargins(4, 0, 0, 0)
        self.leftWiget = QWidget()
        self.leftWiget.setAutoFillBackground(True)
        self.leftWiget.setLayout(self.layoutLeft)
        self.leftWiget.setFixedWidth(22)

        # 右
        self.textEdit = QTextBrowser()
        self.textEdit.setOpenLinks(True)
        self.textEdit.setOpenExternalLinks(True)
        self.textEdit.setReadOnly(True)

        self.rightWiget = QWidget()
        self.rightWiget.setAutoFillBackground(True)
        self.rightWiget.setFixedWidth(15)

        self.messageSplitter = QSplitter(Qt.Horizontal)
        self.messageSplitter.addWidget(self.leftWiget)
        self.messageSplitter.addWidget(self.textEdit)
        self.messageSplitter.addWidget(self.rightWiget)

        self.mainSplitter = QSplitter(Qt.Vertical)
        self.mainSplitter.addWidget(self.functionTabWiget)
        self.mainSplitter.addWidget(self.messageSplitter)
        self.setCentralWidget(self.mainSplitter)

        # 重定向输出

        sys.stdout = ConsoleEmittor(textWritten=self.normalOutputWritten)