Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve: single progress for both quick fail and normal mode #311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions dicogis/georeaders/process_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,32 +259,28 @@ def export_metadataset(
Returns:
dataset to process, metadataset or None if something went wrong
"""
self.update_progress(
message_to_display="Exporting metadata of "
f"{dataset_to_process.file_path.name}..."
)
if self.opt_quick_fail:
self.update_progress(
message_to_display="Exporting metadata of "
f"{dataset_to_process.file_path}..."
)
# writing to the Excel file
self.serializer.serialize_metadaset(metadataset=metadataset_to_serialize)
self.update_progress(
message_to_display="Exporting metadata of "
f"{dataset_to_process.file_path}: OK",
message_to_display="Metadata of "
f"{dataset_to_process.file_path.name}: EXPORTED",
increment_counter=True,
)
logger.debug(f"Exporting metadata of {dataset_to_process.file_path}: OK")
dataset_to_process.exported = True
return dataset_to_process, metadataset_to_serialize

try:
self.update_progress(
message_to_display="Exporting metadata of "
f"{dataset_to_process.file_path}..."
)
# writing to the Excel file
self.serializer.serialize_metadaset(metadataset=metadataset_to_serialize)
self.update_progress(
message_to_display="Exporting metadata of "
f"{dataset_to_process.file_path}: OK",
message_to_display="Metadata of "
f"{dataset_to_process.file_path.name}: EXPORTED",
increment_counter=True,
)
logger.debug(f"Exporting metadata of {dataset_to_process.file_path}: OK")
Expand Down
Loading