Mercurial > repos > yating-l > hubarchivecreator_test
annotate hub-archive-creator/util/cleanDirectory.py @ 6:9193fe3ee73f draft default tip
Uploaded
| author | yating-l |
|---|---|
| date | Thu, 22 Dec 2016 15:59:24 -0500 |
| parents | |
| children |
| rev | line source |
|---|---|
| 6 | 1 #!/usr/bin/python |
| 2 """Use to clean the directory after the run of HubArchiveCreator.py manually""" | |
| 3 import os | |
| 4 import shutil | |
| 5 | |
| 6 # Remove 'myHub.zip at root folder | |
| 7 try: | |
| 8 os.remove('myHub.zip') | |
| 9 except OSError as o: | |
| 10 # We don't need to crash the program | |
| 11 print 'Warning: ' + str(o) | |
| 12 | |
| 13 # Remove 'myHub' folder and its content | |
| 14 shutil.rmtree('myHub', ignore_errors=True) |
