当前位置: 首页>>代码示例>>Python>>正文


Python pyte.Stream方法代码示例

本文整理汇总了Python中pyte.Stream方法的典型用法代码示例。如果您正苦于以下问题:Python pyte.Stream方法的具体用法?Python pyte.Stream怎么用?Python pyte.Stream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyte的用法示例。


在下文中一共展示了pyte.Stream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import pyte [as 别名]
# 或者: from pyte import Stream [as 别名]
def __init__(self, parent=None):
        '''
        Constructor
        '''
        super(self.__class__, self).__init__(parent)
        self.setFont(QtGui.QFont({
            'win32': 'Consolas',
            'linux': 'Monospace',
            'darwin': 'Andale Mono'
        }.get(sys.platform, 'Courier'), 10))
        self.setFocusPolicy(QtCore.Qt.ClickFocus)
        self.setStyleSheet("background-color : black; color : #cccccc;")
        self._workers = []
        self._serial = None
        self._thread = None
        self._stream = pyte.Stream()
        self._vt = pyte.Screen(80, 24)
        self._stream.attach(self._vt)
        self._workers.append(self._processText)
        self._stop = threading.Event() 
开发者ID:martinribelotta,项目名称:uPyIDE,代码行数:22,代码来源:termWidget.py

示例2: __init__

# 需要导入模块: import pyte [as 别名]
# 或者: from pyte import Stream [as 别名]
def __init__(self):
        # Initialize the pyte screen based on the current screen size
        # noinspection PyUnresolvedReferences
        self.screen = pyte.screens.DiffScreen(*_stash.terminal.get_wh())
        self.stream = pyte.Stream()
        self.stream.attach(self.screen)

        self.client = paramiko.SSHClient()
        self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 
开发者ID:ywangd,项目名称:stash,代码行数:11,代码来源:ssh.py

示例3: __init__

# 需要导入模块: import pyte [as 别名]
# 或者: from pyte import Stream [as 别名]
def __init__(self):
        # Initialize the pyte screen based on the current screen size
        # noinspection PyUnresolvedReferences
        self.screen = pyte.screens.DiffScreen(*_stash.terminal.get_wh())
        self.stream = pyte.Stream()
        self.stream.attach(self.screen)

        self.client = None 
开发者ID:ywangd,项目名称:stash,代码行数:10,代码来源:telnet.py

示例4: _get_output_lines

# 需要导入模块: import pyte [as 别名]
# 或者: from pyte import Stream [as 别名]
def _get_output_lines(output):
    lines = output.split('\n')
    screen = pyte.Screen(get_terminal_size().columns, len(lines))
    stream = pyte.Stream(screen)
    stream.feed('\n'.join(lines))
    return screen.display 
开发者ID:nvbn,项目名称:thefuck,代码行数:8,代码来源:shell_logger.py

示例5: _get_output_lines

# 需要导入模块: import pyte [as 别名]
# 或者: from pyte import Stream [as 别名]
def _get_output_lines(script, log_file):
    data = log_file.read().decode()
    data = re.sub(r'\x00+$', '', data)
    lines = data.split('\n')
    grouped = list(_group_by_calls(lines))
    script_lines = _get_script_group_lines(grouped, script)
    screen = pyte.Screen(get_terminal_size().columns, len(script_lines))
    stream = pyte.Stream(screen)
    stream.feed('\n'.join(script_lines))
    return screen.display 
开发者ID:nvbn,项目名称:thefuck,代码行数:12,代码来源:read_log.py


注:本文中的pyte.Stream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。