當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。