|
@ -28,7 +28,11 @@ VERSION = "1.4.0" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def run_command_shell( |
|
|
async def run_command_shell( |
|
|
command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, on_success: List[Callable] = [()]): |
|
|
|
|
|
|
|
|
command, |
|
|
|
|
|
stdout=asyncio.subprocess.PIPE, |
|
|
|
|
|
stderr=asyncio.subprocess.PIPE, |
|
|
|
|
|
on_success: List[Callable] = [()] |
|
|
|
|
|
): |
|
|
"""Run command in subprocess (shell). |
|
|
"""Run command in subprocess (shell). |
|
|
|
|
|
|
|
|
Note: |
|
|
Note: |
|
@ -43,7 +47,8 @@ async def run_command_shell( |
|
|
|
|
|
|
|
|
if process.returncode == 0: |
|
|
if process.returncode == 0: |
|
|
for callable in on_success: |
|
|
for callable in on_success: |
|
|
callable() |
|
|
|
|
|
|
|
|
if callable is not None: |
|
|
|
|
|
callable() |
|
|
|
|
|
|
|
|
if stdout != asyncio.subprocess.DEVNULL: |
|
|
if stdout != asyncio.subprocess.DEVNULL: |
|
|
result = process_stdout.decode().strip() |
|
|
result = process_stdout.decode().strip() |
|
|