Skip to content

Commit

Permalink
now it actually uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-butcher committed Jun 19, 2024
1 parent 6739903 commit e66ec8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/transferrer/make_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def generate_metadata_csv(csvfile, accession_id):
writer.writeheader()
writer.writerow(
{
"filename": "/objects",
"filename": "objects/",
"collection_reference": "WT",
"accession_number": accession_id,
}
Expand Down Expand Up @@ -90,7 +90,6 @@ def create_born_digital_zips(
source_directory, target_directory, accession_number, shoot_number, max_batch_size
):
filenames = files_in_folder(source_directory)

if len(filenames) == 0:
raise FileNotFoundError(
"Attempt to build born digital accession zip from empty folder"
Expand Down Expand Up @@ -134,3 +133,7 @@ def batched(iterable, n):
while batch := tuple(itertools.islice(iterator, n)):
yield batch


if __name__ == "__main__":
import sys
list(create_born_digital_zips(sys.argv[1], '.', "1234", sys.argv[2], 99))
2 changes: 1 addition & 1 deletion src/transferrer/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def get_target_bucket(s3, target_bucket):


if __name__ == "__main__":
upload(boto3.Session(os.environ["AWS_TARGET_PROFILE"]).resource('s3'), sys.argv[1])
upload( boto3.Session(profile_name=os.environ["AWS_TARGET_PROFILE"]).resource('s3'), sys.argv[1])

0 comments on commit e66ec8a

Please sign in to comment.