EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit d28b76a1 authored by Lubomir Dolezal's avatar Lubomir Dolezal
Browse files

some minor fixes, uploading also content of 'extra' folder

parent 78a1b35c
No related branches found
No related tags found
No related merge requests found
......@@ -223,12 +223,14 @@ def preprocess_file(config: dict, file_path: os.PathLike, use_dir: os.PathLike=N
uploader = get_uploader(
target_config['type'], target_config.get('args'), target_config.get('kwargs')
)
upload_filenames = [
os.path.join(dirpath, filename)
for dirpath, _, filenames in os.walk('upload')
for filename in filenames
]
paths_for_upload = ['upload', 'extra']
upload_filenames = []
for path_to_upload in paths_for_upload:
upload_filenames.extend([
os.path.join(dirpath, filename)
for dirpath, _, filenames in os.walk(path_to_upload)
for filename in filenames
])
# send all files in the upload directory to the target storage
logger.info(
......@@ -285,10 +287,11 @@ def preprocess_browse(config: dict, browse_type: str, browse_report: dict, brows
# TODO: check if allowed and download from there
raise NotImplementedError
os.mkdir('unpack')
if not os.path.isdir('unpack'):
os.mkdir('unpack')
logger.info('Applying browse georeference to browse %s' % filename)
browse_georeference('download', 'unpack', browse_type, browse)
browse_georeference('download', 'unpack', browse_report, browse)
# fetch the product type from the browse_type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment