本文整理汇总了Python中asyncio.SubprocessTransport方法的典型用法代码示例。如果您正苦于以下问题:Python asyncio.SubprocessTransport方法的具体用法?Python asyncio.SubprocessTransport怎么用?Python asyncio.SubprocessTransport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asyncio
的用法示例。
在下文中一共展示了asyncio.SubprocessTransport方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_subprocess_transport_not_implemented
# 需要导入模块: import asyncio [as 别名]
# 或者: from asyncio import SubprocessTransport [as 别名]
def test_subprocess_transport_not_implemented(self):
transport = asyncio.SubprocessTransport()
self.assertRaises(NotImplementedError, transport.get_pid)
self.assertRaises(NotImplementedError, transport.get_returncode)
self.assertRaises(NotImplementedError, transport.get_pipe_transport, 1)
self.assertRaises(NotImplementedError, transport.send_signal, 1)
self.assertRaises(NotImplementedError, transport.terminate)
self.assertRaises(NotImplementedError, transport.kill)
示例2: __init__
# 需要导入模块: import asyncio [as 别名]
# 或者: from asyncio import SubprocessTransport [as 别名]
def __init__(self, connected, out_recevied, err_recevied, ended, logfile=None):
self.connected = connected
self.out_recevied = out_recevied
self.err_recevied = err_recevied
self.ended = ended
self.logfile = logfile
self.transport: asyncio.SubprocessTransport
self.protocol: _Protocol
示例3: connection_made
# 需要导入模块: import asyncio [as 别名]
# 或者: from asyncio import SubprocessTransport [as 别名]
def connection_made(self, transport):
"""Used to signal `asyncio.Protocol` of a successful connection."""
self._transport = transport
self._raw_transport = transport
if isinstance(transport, asyncio.SubprocessTransport):
self._transport = transport.get_pipe_transport(0)