Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds -keep-original CLI option to retain staging files, fixes #1 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kieranjol
Copy link

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:

  • The FileStager class in staging.py no longer sets the default as True for remove_original, this is now done in defaults.py
  • A --keep-original argument was added which sets the remove_original value to be False. I tried a few ways of doing this and this seemed like the least worst method.
  • Some re-arragement of arguments in staging.py had to be done so that the args with defaults came last.
  • Seeing as the FileStager class was only initiated in _stage_file, I took the perhaps incorrect route of adding remove_original value to files_iterable which allowed the information to eventually be present when initialising FileStager

In terms of testing - On Windows I used staging to move a folder to one other output directory. Adding --keep-original resulted 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.

@kieranjol
Copy link
Author

ping :)

@kieranjol
Copy link
Author

Just checking back in on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Staging - add option to retain source
1 participant