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


Python connection.EXTENDED_DATA_STDERR属性代码示例

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


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

示例1: test_lookupSubsystem_data

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def test_lookupSubsystem_data(self):
        """
        After having looked up a subsystem, data should be passed along to the
        client.  Additionally, subsystems were passed the entire request packet
        as data, instead of just the additional data.

        We check for the additional tidle to verify that the data passed
        through the client.
        """
        #self.session.dataReceived('1')
        # subsystems didn't get extended data
        #self.session.extReceived(connection.EXTENDED_DATA_STDERR, '2')

        self.session.requestReceived(b'subsystem',
                                     common.NS(b'TestSubsystem') + b'data')

        self.assertEqual(self.session.conn.data[self.session],
                [b'\x00\x00\x00\x0dTestSubsystemdata~'])
        self.session.dataReceived(b'more data')
        self.assertEqual(self.session.conn.data[self.session][-1],
                b'more data~') 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:23,代码来源:test_session.py

示例2: test_lookupSubsystem_data

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def test_lookupSubsystem_data(self):
        """
        After having looked up a subsystem, data should be passed along to the
        client.  Additionally, subsystems were passed the entire request packet
        as data, instead of just the additional data.

        We check for the additional tidle to verify that the data passed
        through the client.
        """
        #self.session.dataReceived('1')
        # subsystems didn't get extended data
        #self.session.extReceived(connection.EXTENDED_DATA_STDERR, '2')

        self.session.requestReceived('subsystem',
                                     common.NS('TestSubsystem') + 'data')

        self.assertEquals(self.session.conn.data[self.session],
                ['\x00\x00\x00\x0dTestSubsystemdata~'])
        self.session.dataReceived('more data')
        self.assertEquals(self.session.conn.data[self.session][-1],
                'more data~') 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:23,代码来源:test_session.py

示例3: extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def extReceived(self, dataType, data):
            if dataType == connection.EXTENDED_DATA_STDERR:
                self.receivedExt.append(data)
            else:
                log.msg("Unrecognized extended data: %r" % (dataType,)) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:7,代码来源:test_ssh.py

示例4: test_client_extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def test_client_extReceived(self):
        """
        SSHSession.extReceived() passed data of type EXTENDED_DATA_STDERR along
        to the client.  If the data comes before there is a client, or if the
        data is not of type EXTENDED_DATA_STDERR, it is discared.
        """
        self.session.extReceived(connection.EXTENDED_DATA_STDERR, b'1')
        self.session.extReceived(255, b'2') # 255 is arbitrary
        self.session.client = StubClient()
        self.session.extReceived(connection.EXTENDED_DATA_STDERR, b'3')
        self.assertEqual(self.session.client.transport.err, b'3') 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:13,代码来源:test_session.py

示例5: test_client_extReceivedWithoutWriteErr

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def test_client_extReceivedWithoutWriteErr(self):
        """
        SSHSession.extReceived() should handle the case where the transport
        on the client doesn't have a writeErr method.
        """
        client = self.session.client = StubClient()
        client.transport = StubTransport() # doesn't have writeErr

        # should not raise an error
        self.session.extReceived(connection.EXTENDED_DATA_STDERR, b'ignored') 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:12,代码来源:test_session.py

示例6: extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def extReceived(self, t, data):
        if t==connection.EXTENDED_DATA_STDERR:
            log.msg('got %s stderr data' % len(data))
            sys.stderr.write(data)
            sys.stderr.flush() 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:7,代码来源:cftp.py

示例7: extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def extReceived(self, dataType, data):
        if dataType == connection.EXTENDED_DATA_STDERR:
            if self.client and hasattr(self.client.transport, 'writeErr'):
                self.client.transport.writeErr(data)
        else:
            log.msg('weird extended data: %s'%dataType) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:8,代码来源:session.py

示例8: errReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def errReceived(self, err):
        self.session.writeExtended(connection.EXTENDED_DATA_STDERR, err) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:4,代码来源:session.py

示例9: extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def extReceived(self, ext_type, data):
    from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR
    if ext_type == EXTENDED_DATA_STDERR:
        self.dataReceived(data) 
开发者ID:ClusterHQ,项目名称:flocker,代码行数:6,代码来源:_conch.py

示例10: extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def extReceived(self, dataType, data):
            unittest.assertEquals(dataType, connection.EXTENDED_DATA_STDERR)
            self.testBuf += data 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:5,代码来源:test_ssh.py

示例11: test_client_extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def test_client_extReceived(self):
        """
        SSHSession.extReceived() passed data of type EXTENDED_DATA_STDERR along
        to the client.  If the data comes before there is a client, or if the
        data is not of type EXTENDED_DATA_STDERR, it is discared.
        """
        self.session.extReceived(connection.EXTENDED_DATA_STDERR, '1')
        self.session.extReceived(255, '2') # 255 is arbitrary
        self.session.client = StubClient()
        self.session.extReceived(connection.EXTENDED_DATA_STDERR, '3')
        self.assertEquals(self.session.client.transport.err, '3') 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:13,代码来源:test_session.py

示例12: test_client_extReceivedWithoutWriteErr

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def test_client_extReceivedWithoutWriteErr(self):
        """
        SSHSession.extReceived() should handle the case where the transport
        on the client doesn't have a writeErr method.
        """
        client = self.session.client = StubClient()
        client.transport = StubTransport() # doesn't have writeErr

        # should not raise an error
        self.session.extReceived(connection.EXTENDED_DATA_STDERR, 'ignored') 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:12,代码来源:test_session.py

示例13: extReceived

# 需要导入模块: from twisted.conch.ssh import connection [as 别名]
# 或者: from twisted.conch.ssh.connection import EXTENDED_DATA_STDERR [as 别名]
def extReceived(self, t, data):
        if t==connection.EXTENDED_DATA_STDERR:
            log.msg('got %s stderr data' % len(data))
            sys.stderr.write(data) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:6,代码来源:conch.py


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