Skip to content

Commit

Permalink
Address #845.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Nov 26, 2024
1 parent 5ca5101 commit 0dcd0f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions WorkbenchConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def get_default_config(self):
"allow_csv_value_templates_if_field_empty": [],
"remind_user_to_run_check": False,
"media_type_by_media_use": False,
"paged_content_ignore_files": ["Thumbs.db"]
}

# Tests validity and existence of configuration file path.
Expand Down
24 changes: 14 additions & 10 deletions workbench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3649,16 +3649,17 @@ def check_input(config, args):
print("Warning: " + message)
logging.warning(message)
for page_file_name in page_files:
if config["paged_content_sequence_separator"] not in page_file_name:
message = (
"Page file "
+ os.path.join(dir_path, page_file_name)
+ " does not contain a sequence separator ("
+ config["paged_content_sequence_separator"]
+ ")."
)
logging.error(message)
sys.exit("Error: " + message)
if page_file_name.strip().lower() not in [fn.strip().lower() for fn in config["paged_content_ignore_files"]]:
if config["paged_content_sequence_separator"] not in page_file_name:
message = (
"Page file "
+ os.path.join(dir_path, page_file_name)
+ " does not contain a sequence separator ("
+ config["paged_content_sequence_separator"]
+ ")."
)
logging.error(message)
sys.exit("Error: " + message)

print("OK, page directories are all present.")

Expand Down Expand Up @@ -8629,6 +8630,9 @@ def create_children_from_directory(config, parent_csv_record, parent_node_id):
required_fields = get_required_bundle_fields(config, "node", config["content_type"])

for page_file_name in page_files:
if page_file_name.strip().lower() in [fn.strip().lower() for fn in config["paged_content_ignore_files"]]:
continue

filename_without_extension = os.path.splitext(page_file_name)[0]
filename_segments = filename_without_extension.split(
config["paged_content_sequence_separator"]
Expand Down

0 comments on commit 0dcd0f1

Please sign in to comment.