Extra validation of the uploaded ZIP #73
@ -72,13 +72,11 @@ def find_full_path(
|
||||
def filter_paths_by_ext(paths: typing.List[str], ext: str) -> typing.Iterable[str]:
|
||||
"""Generate a list of paths having a given extension from a given list of paths."""
|
||||
for file_path in paths:
|
||||
# Remove leading/trailing whitespace from file path
|
||||
file_path_stripped = file_path.strip()
|
||||
# Get file path's extension
|
||||
_, file_path_ext = os.path.splitext(file_path_stripped)
|
||||
_, file_path_ext = os.path.splitext(file_path)
|
||||
# Check if this file's extension matches the extension we are looking for
|
||||
if file_path_ext.lower() == ext.lower():
|
||||
yield file_path_stripped
|
||||
yield file_path
|
||||
|
||||
|
||||
def read_manifest_from_zip(archive_path):
|
||||
|
Loading…
Reference in New Issue
Block a user