Small refactor: add keep parameter to stage, get rid of stage.destroy call.

- package.py uses context manager more effectively.

- Stage.__init__ has easier to understand method signature now.
  - keep can be used to override the default behavior either to keep
    the stage ALL the time or to delete the stage ALL the time.
This commit is contained in:
Todd Gamblin
2016-03-05 19:55:07 -08:00
parent 14d48eba46
commit ad103dcafa
4 changed files with 141 additions and 90 deletions

View File

@@ -362,8 +362,9 @@ def remove_dead_links(root):
def remove_linked_tree(path):
"""
Removes a directory and its contents. If the directory is a symlink, follows the link and removes the real
directory before removing the link.
Removes a directory and its contents. If the directory is a
symlink, follows the link and removes the real directory before
removing the link.
Args:
path: directory to be removed