Add an option to not to move the payload into a subdirectory on bag create #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When creating a new bag,
make_bag()
takes the bag directory as argument. It assumes the current content of this bag directory to be the payload. It creates a new subdirectorydata
and moves all content of the bag directory into this new subdirectory.Now, I have a use case, where I must access the payload read only when creating a new bag. I cannot move the payload. But I can arrange the payload to be already in the right place from the beginning. So I need an option to tell
make_bag()
: "Do not move the payload, it's already right there where it should be."This PR adds this option: it adds a new optional flag
move_payload
tomake_bag()
. If this flag isTrue
, the default,make_bag()
behaves exactly as before: it creates the payload directory and moves the current content of the bag dir into this subdirectory. If the flag isFalse
,make_bag()
assumes that the payload directory is already at its place and verifies that the bag dir does not contain anything else then this payload directory. The PR furthermore makes the new flag accessible by a new command line option tobagit.py
.