Setting up Client, Target, and Airodump wrappers

Fixed bugs in Process and other related classes.
This commit is contained in:
derv82
2015-05-27 20:26:30 -07:00
parent 33dff208ed
commit 1f2ebc9914
6 changed files with 290 additions and 42 deletions

View File

@@ -34,15 +34,20 @@ class Process(object):
return True
def __init__(self, command):
def __init__(self, command, devnull=False):
''' Starts executing command '''
if type(command) == str:
# Commands have to be a list
command = command.split(' ')
self.command = command
self.out = None
self.err = None
self.pid = Popen(command, stdout=PIPE, stderr=PIPE)
if devnull:
sout = Process.devnull()
serr = Process.devnull()
else:
sout = PIPE
serr = PIPE
self.pid = Popen(command, stdout=sout, stderr=serr)
def stdout(self):
''' Waits for process to finish, returns stdout output '''