From 20bf16305dd1c688fe62150e134878ea0fabeb3b Mon Sep 17 00:00:00 2001 From: prodigysml Date: Mon, 3 Jun 2019 22:26:46 -0700 Subject: [PATCH 1/3] Fixed the sober flag --- Interlace/lib/core/input.py | 2 +- Interlace/lib/threader.py | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 260d155..ea6a308 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -355,7 +355,7 @@ class InputParser(object): ) parser.add_argument( - '--no-bar', '--sober', dest='sober', action='store_true', default=True, + '--no-bar', '--sober', dest='sober', action='store_true', default=False, help='If set then progress bar will be stripped out' ) diff --git a/Interlace/lib/threader.py b/Interlace/lib/threader.py index 65528a4..f33b882 100644 --- a/Interlace/lib/threader.py +++ b/Interlace/lib/threader.py @@ -16,17 +16,22 @@ class Worker(object): try: # get task from queue task = self.queue.pop(0) - if self.tqdm: + if isinstance(self.tqdm, tqdm): self.tqdm.update(1) - # run task - self.run_task(task, self.tqdm) + # run task + self.run_task(task, self.tqdm) + else: + self.run_task(task) except IndexError: break @staticmethod - def run_task(task, t): - s = subprocess.Popen(task, shell=True, stdout=subprocess.PIPE) - t.write(s.stdout.readline().decode("utf-8")) + def run_task(task, t=False): + if t: + s = subprocess.Popen(task, shell=True, stdout=subprocess.PIPE) + t.write(s.stdout.readline().decode("utf-8")) + else: + subprocess.Popen(task, shell=True) class Pool(object): @@ -48,10 +53,10 @@ class Pool(object): self.output = output self.max_workers = max_workers - if progress_bar: + if not progress_bar: self.tqdm = tqdm(total=len(queue)) else: - self.tqdm = False + self.tqdm = True def run(self): From 96d28b15c461087b22c9589317fc2134bef74b90 Mon Sep 17 00:00:00 2001 From: prodigysml Date: Mon, 3 Jun 2019 22:34:26 -0700 Subject: [PATCH 2/3] Increment version --- Interlace/lib/core/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interlace/lib/core/__version__.py b/Interlace/lib/core/__version__.py index 51ed7c4..c3b3841 100644 --- a/Interlace/lib/core/__version__.py +++ b/Interlace/lib/core/__version__.py @@ -1 +1 @@ -__version__ = '1.5.1' +__version__ = '1.5.2' From 387225e3ed0f55281b7c8a9ec33e37e44cb76c27 Mon Sep 17 00:00:00 2001 From: Michael Skelton <886344+codingo@users.noreply.github.com> Date: Tue, 4 Jun 2019 15:39:35 +1000 Subject: [PATCH 3/3] Banner char length update --- Interlace/lib/core/output.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Interlace/lib/core/output.py b/Interlace/lib/core/output.py index 3151670..563ef3b 100644 --- a/Interlace/lib/core/output.py +++ b/Interlace/lib/core/output.py @@ -12,14 +12,15 @@ class OutputHelper(object): self.verbose = arguments.verbose self.silent = arguments.silent - self.seperator = "=================================================================================" + self.seperator = "=====================================================" def print_banner(self): if self.silent: return print(self.seperator) - print("Interlace v%s\tby Michael Skelton (@codingo_) & Sajeeb Lohani (@sml555_)" % __version__) + print("Interlace v%s\tby Michael Skelton (@codingo_)" % __version__) + print(" & Sajeeb Lohani (@sml555_)") print(self.seperator) def terminal(self, level, target, command, message=""):