adds -keep-original CLI option to retain staging files, fixes #1 #3
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.
This is an attempt for fix #1 . I'm sure that there were many ways to do this but here's a summary of my changes:
FileStagerclass instaging.pyno longer sets the default as True forremove_original, this is now done indefaults.py--keep-originalargument was added which sets theremove_originalvalue to beFalse. I tried a few ways of doing this and this seemed like the least worst method.staging.pyhad to be done so that the args with defaults came last.FileStagerclass was only initiated in_stage_file, I took the perhaps incorrect route of addingremove_originalvalue tofiles_iterablewhich allowed the information to eventually be present when initialisingFileStagerIn terms of testing - On Windows I used staging to move a folder to one other output directory. Adding
--keep-originalresulted in my source staging remaining intact, while removing this option resulted in the default behaiour prior to this patch - the source files are deleted after successful completion.