erm, echo was removed.. since it's part of the opts now

This commit is contained in:
Anton Hvornum 2019-04-11 21:11:57 +02:00
parent 2d4ae27454
commit 15cdae12cc
1 changed files with 3 additions and 3 deletions

View File

@ -176,19 +176,19 @@ class sys_command():
def simple_command(cmd, opts=None, *args, **kwargs):
if not opts: opts = {}
if echo or 'debug' in opts:
if 'debug' in opts:
print('[!] {}'.format(cmd))
handle = Popen(cmd, shell='True', stdout=PIPE, stderr=STDOUT, stdin=PIPE, **kwargs)
output = b''
while handle.poll() is None:
data = handle.stdout.read()
if len(data):
if echo or 'debug' in opts:
if 'debug' in opts:
print(data.decode('UTF-8'), end='')
# print(data.decode('UTF-8'), end='')
output += data
data = handle.stdout.read()
if echo or 'debug' in opts:
if 'debug' in opts:
print(data.decode('UTF-8'), end='')
output += data
handle.stdin.close()