本文整理匯總了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