From 57baa9e9fd42bafcc5224f20d9b0a95e39a90695 Mon Sep 17 00:00:00 2001 From: weckyy702 Date: Sun, 27 Dec 2020 16:31:04 +0100 Subject: [PATCH] removed debugging only parts of all files --- draw/Iinstruction.py | 19 +------------------ draw/code_to_image.py | 11 +---------- gui/utils.py | 6 +----- interpreter/NassiShneidermann.py | 11 +---------- 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/draw/Iinstruction.py b/draw/Iinstruction.py index b73cff6..3cacee9 100644 --- a/draw/Iinstruction.py +++ b/draw/Iinstruction.py @@ -132,21 +132,4 @@ class while_instruction_back(while_instruction_front): def to_image(self, x:int, y:int, x_sz: int): children_x, children_y, children_sz_x = cti.draw_while_loop_back(self.instruction_text, x, y, x_sz, self.getblksize()) self.draw_children(children_x, children_y, children_sz_x) - return x, y + self.getblksize() - - -if __name__ == "__main__": - """Debugging""" - test = if_instruction("shouldNiet()", [ - generic_instruction("Niet()"), - generic_instruction("Niet()"), - generic_instruction("Niet()"), - generic_instruction("Niet()"), - ], [ - generic_instruction("hiet()"), - generic_instruction("hiet()"), - if_instruction("shouldNiet()", [ generic_instruction("hiet()") ], [generic_instruction("hiet()")]), - ]) - cti.NSD_init(500, 500) - test.to_image(0, 0, 500) - cti.NSD_save("Iinstruction") \ No newline at end of file + return x, y + self.getblksize() \ No newline at end of file diff --git a/draw/code_to_image.py b/draw/code_to_image.py index 6ccd2b2..5bc1466 100644 --- a/draw/code_to_image.py +++ b/draw/code_to_image.py @@ -120,13 +120,4 @@ def draw_while_loop_back(condition: str, x: int, y: int, xsize: int, ysize: int) def NSD_save(filename: str): """Save the created file""" - img.save(filename + datei_endung ,"PNG") - -#x_offset , y_offset, x_size, y_size = draw_while_loop("lol", 0, 0, 100, 200) -if __name__ == "__main__": - """Debugging :^)""" - NSD_init(300, 500) - #draw_if_statement("wenn das dann mach das", 0, 0, 100, 200) - #print(x,y,xsize,ysize) - #draw_generic_instruction(r"""Wolfgang.fuck("Nina")""", x, y, xsize, ysize) - NSD_save("testink") \ No newline at end of file + img.save(filename + datei_endung ,"PNG") \ No newline at end of file diff --git a/gui/utils.py b/gui/utils.py index 9ba6198..939be9c 100644 --- a/gui/utils.py +++ b/gui/utils.py @@ -23,8 +23,4 @@ def output(values): if os.path.isfile(os.path.join(output_path, f)) and f.lower().endswith(('.png', '.gif')) ] - return fnames - -if __name__ == "__main__": - """Debugging""" - nassi("res/input/input.java", "res/output") \ No newline at end of file + return fnames \ No newline at end of file diff --git a/interpreter/NassiShneidermann.py b/interpreter/NassiShneidermann.py index 48b9cb6..8e107f5 100644 --- a/interpreter/NassiShneidermann.py +++ b/interpreter/NassiShneidermann.py @@ -40,13 +40,4 @@ class NassiShneidermanDiagram: logging.info("Done!") def load_from_file(self, filepath:str): - self.instructions = itp.load_instructions(filepath) - - - -if __name__ == "__main__": - NSD = NassiShneidermanDiagram(True) - - NSD.load_from_file("res/input/input.java") - - NSD.convert_to_image("Nina", 500) + self.instructions = itp.load_instructions(filepath) \ No newline at end of file