config.py 文件源码

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

项目:AlphaHooks 作者: AlphaHooks 项目源码 文件源码
def __init__(self, ui, config, parent=None):
        """
        Loads default configuration for console_log. A new thread is
        spawned to which the interpreter is moved. This is done to
        increase the responsiveness of the main user interface.

        :param ui: used to access 'main.ui' methods
        :param config: used to configure classes
        """
        super(ConsoleProperty, self).__init__(parent)
        self.ui = ui
        self.config = config

        # Document
        self.ui.console_log.document().setMaximumBlockCount(
            self.config["Console"]["Scrollback Buffer"]
        )
        self.ui.console_log.setWordWrapMode(QTextOption.WrapAnywhere)

        # Console Input History
        self.index = -1
        self.length = 0

        readline.set_history_length(50)
        self.ui.console_input.installEventFilter(self)

        try:
            open(self.HISTORY_PATH, "x")
        except FileExistsError:
            readline.read_history_file(self.HISTORY_PATH)
            self.length = readline.get_current_history_length()

        # Display
        self.display = PythonDisplay(self.ui, self.config, self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号