Uncompleted Processing Refactor
This commit is contained in:
@@ -154,6 +154,15 @@ def get_next_incrementing_value(output_base_path: Path, output_directory_pattern
|
||||
logger.info(f"Determined next incrementing value: {next_value_str} (Max found: {max_value})")
|
||||
return next_value_str
|
||||
|
||||
def sanitize_filename(name: str) -> str:
|
||||
"""Removes or replaces characters invalid for filenames/directory names."""
|
||||
if not isinstance(name, str): name = str(name)
|
||||
name = re.sub(r'[^\w.\-]+', '_', name) # Allow alphanumeric, underscore, hyphen, dot
|
||||
name = re.sub(r'_+', '_', name)
|
||||
name = name.strip('_')
|
||||
if not name: name = "invalid_name"
|
||||
return name
|
||||
|
||||
# --- Basic Unit Tests ---
|
||||
if __name__ == "__main__":
|
||||
print("Running basic tests for path_utils.generate_path_from_pattern...")
|
||||
|
||||
Reference in New Issue
Block a user