def load_csv_for_uml(self, input_file='class_data.csv'): if os.path.isfile(input_file) is True: csvloader = csv.CSV_handler() module = csvloader.open_file(input_file) if module is not False: makediagram = UMLout.MakeUML(True, True) return makediagram.create_class_diagram(module) else: return False
def load_csv_for_uml(self, input_file='class_data.csv'): if os.path.isfile(input_file) is True: csvloader = model.FileProcessor() # csvloader = csv.CSV_handler() module = csvloader.open_csv_file(input_file) if module is not False: makediagram = UMLout.MakeUML(True, True) return makediagram.create_class_diagram(module) else: print('Module is reading false') return False
def run_parser(self, hide_attributes, hide_methods): if len(self.files) > 0: # Initiate processor processor = model.FileProcessor() processor.process_files(self.files) self.extracted_modules = processor.get_modules() new_uml = uml_out.MakeUML(hide_attributes, hide_methods) return new_uml.create_class_diagram(self.extracted_modules) else: print("Error: No files were set, use command change_python_files")
def do_load_csv_for_uml(self, params): ''' Loads csv file and creates UML diagram [command line] [file.csv] Author: Peter ''' if params == '': params = 'output.csv' args = params.split(' ') print(args) if len(args) >= 1: input_file = args[0] if input_file.endswith('.csv'): csvloader = csv.CSV_handler() module = csvloader.open_file(input_file) makediagram = uml_out.MakeUML(True, True) if makediagram.create_class_diagram(module): print("{} successfully converted to UML class diagram".format( input_file))
return False except PermissionError: print('You do not have appropriate permissions on ' 'this system to save the file') return False except: print('The system encountered a problem here. ' 'Please turn off your computer,') print('jump up and down three times, flap your arms ' 'and quack like a duck and then try again.') return False if __name__ == '__main__': csvhandler = CSV_handler() newmodule = csvhandler.open_file('plants.csv') # print(newmodule) # print('------------------------------') # doParse = model.FileProcessor() # filenames =["plants.py"] # outfile = filenames[0].replace('.py', '.csv') # doParse.process_files(filenames) # modules = doParse.get_modules() # print(modules) # csvhandler.write_csv_file(modules, outfile) # csvhandler.write_csv_file(newmodule, 'myclass.csv') import uml_output as uml makediagram = uml.MakeUML(True, True) # makediagram.create_class_diagram(newmodule)
def module_to_uml(self, module): makediagram = UMLout.MakeUML(True, True) return makediagram.create_class_diagram(module)
def create_class_diagram(self, filenames): modules = self.run_parser(filenames) newUML = UMLout.MakeUML(False, False) return newUML.create_class_diagram(modules)