Skip to content

Commit bb15748

Browse files
author
Amir Ali
committed
fix: fixed some bugs which occured because of the last commit refactor
1 parent 1077c6c commit bb15748

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/extractors.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def extract_data(patterns : Patterns, content : str) -> ExtractedData:
121121

122122
def prepare_to_extract_data(self, output_file : str, input_file : str, sheet_name : str, patterns : Patterns) -> None:
123123
try:
124+
log_string = ''
125+
124126
assert patterns, 'There is no patterns to extract data'
125127
assert output_file, 'The name of output file is required.'
126128

@@ -148,7 +150,7 @@ def prepare_to_extract_data(self, output_file : str, input_file : str, sheet_nam
148150
# --- handling the log ----
149151

150152
if WithLogging.with_logging:
151-
self.log_found_data()
153+
self.log_found_data(log_string, output_file)
152154

153155
except (FileNotFoundError, AssertionError, PermissionError, ValueError, re.PatternError) as err:
154156
show_error(err)
@@ -165,7 +167,7 @@ def get_extracted_data_string(extracted_data_copy : ExtractedData) -> str:
165167

166168
return log_string
167169

168-
def log_found_data(self):
170+
def log_found_data(self, log_string : str, output_file : str):
169171
log_string += f'\n{output_file!r} saved.' + '\n'
170172
self.log_text.config(state='normal')
171173
self.log_text.delete('1.0','end')

0 commit comments

Comments
 (0)