|
|
@ -28,7 +28,10 @@ class LogFiles(namedtuple("LogFiles", ["folder", "drop_check", "environment"])): |
|
|
|
__slots__ = () |
|
|
|
__slots__ = () |
|
|
|
|
|
|
|
|
|
|
|
def __bool__(self): |
|
|
|
def __bool__(self): |
|
|
|
return self.drop_check and self.environment |
|
|
|
if self.drop_check and self.environment: |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NoLogFileError(IOError): |
|
|
|
class NoLogFileError(IOError): |
|
|
@ -49,11 +52,11 @@ def process_drop_checks(log_files): |
|
|
|
drop_log_df = parse_log_files(log_files.drop_check) |
|
|
|
drop_log_df = parse_log_files(log_files.drop_check) |
|
|
|
|
|
|
|
|
|
|
|
generate_drop_check_chart(drop_log_df) |
|
|
|
generate_drop_check_chart(drop_log_df) |
|
|
|
image_path = log_files.folder / f"{log_files.folder}_drop_check.png" |
|
|
|
image_path = log_files.folder / f"{log_files.folder.name}_drop_check.png" |
|
|
|
plt.savefig(image_path) |
|
|
|
plt.savefig(image_path) |
|
|
|
|
|
|
|
|
|
|
|
missing_drop_df = find_missing_drops(drop_log_df) |
|
|
|
missing_drop_df = find_missing_drops(drop_log_df) |
|
|
|
misssing_drop_list_path = log_files.folder / f"{log_files.folder}_missed_spots.xlsx" |
|
|
|
misssing_drop_list_path = log_files.folder / f"{log_files.folder.name}_missed_spots.xlsx" |
|
|
|
missing_drop_df.to_excel(misssing_drop_list_path) |
|
|
|
missing_drop_df.to_excel(misssing_drop_list_path) |
|
|
|
|
|
|
|
|
|
|
|
return DropProcessResult( |
|
|
|
return DropProcessResult( |
|
|
@ -66,25 +69,25 @@ def process_print_log(log_files): |
|
|
|
print_log = parse_print_log(log_files.environment) |
|
|
|
print_log = parse_print_log(log_files.environment) |
|
|
|
|
|
|
|
|
|
|
|
generate_environment_graph(print_log.environment) |
|
|
|
generate_environment_graph(print_log.environment) |
|
|
|
image_path = log_files.folder / f"{log_files.folder}_environment.png" |
|
|
|
image_path = log_files.folder / f"{log_files.folder.name}_environment.png" |
|
|
|
plt.savefig(image_path) |
|
|
|
plt.savefig(image_path) |
|
|
|
|
|
|
|
|
|
|
|
return PrintLogResult(ProcessResult(print_log.environment, image_path), print_log.info) |
|
|
|
return PrintLogResult(ProcessResult(print_log.environment, image_path), print_log.info) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def process_log_files(log_files): |
|
|
|
|
|
|
|
drop_check_result = process_drop_checks(log_files) |
|
|
|
|
|
|
|
print_log_result = process_print_log(log_files) |
|
|
|
|
|
|
|
return generate_report( |
|
|
|
|
|
|
|
log_files, |
|
|
|
|
|
|
|
drop_check_result.drops, |
|
|
|
|
|
|
|
drop_check_result.missing, |
|
|
|
|
|
|
|
print_log_result.environment, |
|
|
|
|
|
|
|
print_log_result.info, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
def process_log_folder(folder): |
|
|
|
def process_log_folder(folder): |
|
|
|
with warnings.catch_warnings(): |
|
|
|
log_files = get_log_files(folder) |
|
|
|
warnings.simplefilter("ignore") |
|
|
|
return process_log_files(log_files) |
|
|
|
log_files = get_log_files(folder) |
|
|
|
|
|
|
|
drop_check_result = process_drop_checks(log_files) |
|
|
|
|
|
|
|
print_log_result = process_print_log(log_files) |
|
|
|
|
|
|
|
return generate_report( |
|
|
|
|
|
|
|
log_files, |
|
|
|
|
|
|
|
drop_check_result.drops, |
|
|
|
|
|
|
|
drop_check_result.missing, |
|
|
|
|
|
|
|
print_log_result.environment, |
|
|
|
|
|
|
|
print_log_result.info, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def open_with_default_app(some_path): |
|
|
|
def open_with_default_app(some_path): |
|
|
|