def run(self): #getting a list of documents file name and its respective paths documents, documents_path = Invoice.get_files(self.path) print('Fetched files') #getting a list of word counts of the document wordcount = Invoice.all_file_wordcount(documents_path) print('Fetched word counts') #list of rounded off word counts dummy_count = Invoice.dummy_wordcount(wordcount) print('Fetched dummy count') #list of properties property_create, property_modified, property_title = Invoice.getProperties( documents_path) print('Fetched properties') #getting list of values property_values = Invoice.proper_properties( documents, property_title, property_create, property_modified, wordcount, dummy_count, self.title_bool, self.dummy_bool) print('Fetched proper properties') #fetch dictionary of data of properties data = Invoice.dictionary(property_values, self.title_bool, self.dummy_bool) print('Fetched Data') #drawing table table = Invoice.table(data) print('Table Drawn') #exporting the table to an excel file Invoice.export(table, self.file_path, self.filename) print('Invoice Saved')
##path = 'D:/python/alexda_project/docx' ##file_path = 'D:/python/alexda_project/docx/invoice' ##filename = 'demo2' ##title_bool = False ##dummy_bool = False files_name, files_path = Invoice.get_files(path) print('files:') for i in range(len(files_name)): print(files_name[i]) print('\n\nfiles path: ') for i in range(len(files_name)): print(files_path[i]) print('\n\nWordcounts:') wordcount = Invoice.all_file_wordcount(files_path) for i in range(len(wordcount)): print(wordcount[i]) print('\n\ndummy wordcounts:') dummy = Invoice.dummy_wordcount(wordcount) for i in range(len(dummy)): print(dummy[i]) c, m, t = Invoice.getProperties(files_path) print('\n\nCreated:') for i in range(len(c)): print(c[i]) print('\n\nModified') for i in range(len(m)): print(m[i])