def write_to_disk(self, outputfolder): errorfile = os.path.join(outputfolder, "error_" + filesys.get_nice_date("Alt") + ".txt") with open(errorfile, 'w') as outfile: for dictitem in self.errordict: outfile.write(str(dictitem) + '\n') for listitem in self.errordict[dictitem]: outfile.write(str(listitem) + '\n') outfile.write('\n') outfile.write("+" * 100) outfile.write('\n') return errorfile
def run_tool(self, dbconn, check_tables_only, check_fcs_only, output_folder): check_list = [] gdbbrowser = datastore.GDBBrowser(dbconn) if check_fcs_only == False and check_tables_only == True: check_list = gdbbrowser.tablelist if check_fcs_only == True and check_tables_only == False: check_list = gdbbrowser.fclist if check_fcs_only == True and check_tables_only == True: check_list = gdbbrowser.fclist + gdbbrowser.tablelist ###--Add a check and a message back to user if they choose False, False versioned_dict = self.is_item_versioned(check_list) output_json_file = os.path.join(output_folder, "json_" + filesys.get_nice_date("Alt") + ".txt") if len(versioned_dict) > 0: json_data = json.dumps(versioned_dict) with open(output_json_file, 'w') as outfile: json.dump(json_data, outfile) webbrowser.open(output_json_file) return else: return []