selfprivacy-rest-api/selfprivacy_api/backup/util.py

15 lines
349 B
Python
Raw Normal View History

import subprocess
def output_yielder(command):
with subprocess.Popen(
command,
shell=False,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
) as handle:
for line in iter(handle.stdout.readline, ""):
if "NOTICE:" not in line:
yield line