-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add end(ish)-to-end transfer feature
- Loading branch information
1 parent
62b38b4
commit 98276fa
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import logging | ||
import os | ||
import tempfile | ||
from transferrer.download import download_shoot | ||
from transferrer.make_zip import create_born_digital_zips | ||
from transferrer.upload import upload | ||
|
||
|
||
def transfer_shoot(shoot_number, accession_number): | ||
with tempfile.TemporaryDirectory() as tmpfolder: | ||
source_folder = os.path.join(tmpfolder, "source") | ||
target_folder = os.path.join(tmpfolder, "target") | ||
download_shoot(shoot_number, source_folder) | ||
for zipfile in create_born_digital_zips(source_folder, target_folder, accession_number, shoot_number, 250): | ||
upload(zipfile) | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
transfer_shoot(sys.argv[1], "2754") |