From 4a4646bdbc8dbfdeac064e9c1a6d9d55fc270fd1 Mon Sep 17 00:00:00 2001 From: weckyy702 Date: Sun, 24 Jan 2021 22:03:32 +0100 Subject: [PATCH] . --- interpreter/NassiShneidermann.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/interpreter/NassiShneidermann.py b/interpreter/NassiShneidermann.py index 780c989..3fcc61d 100644 --- a/interpreter/NassiShneidermann.py +++ b/interpreter/NassiShneidermann.py @@ -55,15 +55,11 @@ class NassiShneidermanDiagram: return filepath def convert_to_image(self, output_path: str, on_conflict: Overwrite_behaviour=OB.SKIP) -> bool: - number_of_item = 1 + i = 0 for scope in self.function_scopes: - #this shizz is not my fault. Ole was the stupid one - number_of_item += 1 - try: - cancel = one_line_progress_meter('Progress', number_of_item, len(self.function_scopes), '-PROGRESSBAR-') - if not cancel: - return False - #I am the one responsible from here on + cancel = one_line_progress_meter('Progress', i+1, len(self.function_scopes), '-PROGRESSBAR-') + if not cancel: + return False filepath = f"{output_path}/{scope.name}" filepath = self.check_conflicts(filepath, on_conflict) @@ -78,6 +74,7 @@ class NassiShneidermanDiagram: except: logging.error(f"Failed to save image {filepath}. Unknown error") raise + i+=1 return True def load_from_file(self, filepath:str, itp_custom_tags: Optional[Dict[str, List[str]]]):