本文整理汇总了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()
示例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())
示例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
示例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
示例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