erm, echo was removed.. since it's part of the opts now
This commit is contained in:
parent
2d4ae27454
commit
15cdae12cc
|
|
@ -176,19 +176,19 @@ class sys_command():
|
||||||
|
|
||||||
def simple_command(cmd, opts=None, *args, **kwargs):
|
def simple_command(cmd, opts=None, *args, **kwargs):
|
||||||
if not opts: opts = {}
|
if not opts: opts = {}
|
||||||
if echo or 'debug' in opts:
|
if 'debug' in opts:
|
||||||
print('[!] {}'.format(cmd))
|
print('[!] {}'.format(cmd))
|
||||||
handle = Popen(cmd, shell='True', stdout=PIPE, stderr=STDOUT, stdin=PIPE, **kwargs)
|
handle = Popen(cmd, shell='True', stdout=PIPE, stderr=STDOUT, stdin=PIPE, **kwargs)
|
||||||
output = b''
|
output = b''
|
||||||
while handle.poll() is None:
|
while handle.poll() is None:
|
||||||
data = handle.stdout.read()
|
data = handle.stdout.read()
|
||||||
if len(data):
|
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='')
|
||||||
# print(data.decode('UTF-8'), end='')
|
# print(data.decode('UTF-8'), end='')
|
||||||
output += data
|
output += data
|
||||||
data = handle.stdout.read()
|
data = handle.stdout.read()
|
||||||
if echo or 'debug' in opts:
|
if 'debug' in opts:
|
||||||
print(data.decode('UTF-8'), end='')
|
print(data.decode('UTF-8'), end='')
|
||||||
output += data
|
output += data
|
||||||
handle.stdin.close()
|
handle.stdin.close()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue