[BREAK] Checkin

This commit is contained in:
Michael Skelton
2018-10-23 22:25:56 +10:00
parent 60ac52c7e8
commit 053853c53d
2 changed files with 8 additions and 7 deletions

View File

@@ -6,24 +6,24 @@ from lib.core.threader import Pool
def build_queue(arguments, output):
queue = ""
queue = list()
for target in InputHelper.process_targets(arguments):
for command in InputHelper.process_commands(arguments):
output.terminal(Level.VERBOSE, target, command, "Added to Queue")
queue += command
queue.append(command)
return queue
def main():
parser = InputParser()
arguments = parser.parse(sys.argv[1:])
output = OutputHelper(arguments)
output.print_banner()
#pool = Pool(arguments.threads, )
pool = build_queue(arguments, output)
print(pool)
pool = Pool(arguments.threads, build_queue(arguments, output), arguments.timeout, output)
pool.run()
if __name__ == "__main__":

View File

@@ -23,12 +23,13 @@ class Worker(object):
class Pool(object):
def __init__(self, max_workers, queue, timeout):
def __init__(self, max_workers, queue, timeout, output):
self.queue = queue
self.workers = [Worker(self) for w in range(max_workers)]
self.timeout = timeout
self.output = output
def run(self, command):
def run(self):
while True:
# make sure resources are available