File: impl_aep_asyncio.py

package info (click to toggle)
ros-osrf-pycommon 2.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 360 kB
  • sloc: python: 1,726; makefile: 146; xml: 16
file content (14 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from osrf_pycommon.process_utils.async_execute_process import async_execute_process
from osrf_pycommon.process_utils import get_loop

from .impl_aep_protocol import create_protocol

loop = get_loop()


async def run(cmd, **kwargs):
    transport, protocol = await async_execute_process(
        create_protocol(), cmd, **kwargs)
    retcode = await protocol.complete
    transport.close()
    return protocol.stdout_buffer, protocol.stderr_buffer, retcode