Mercurial > repos > yating-l > hub_test
annotate util/cleanDirectory.py @ 0:abcfd662b679 draft default tip
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
| author | yating-l |
|---|---|
| date | Thu, 22 Dec 2016 17:53:00 -0500 |
| parents | |
| children |
| rev | line source |
|---|---|
|
0
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
1 #!/usr/bin/python |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
2 """Use to clean the directory after the run of HubArchiveCreator.py manually""" |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
3 import os |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
4 import shutil |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
5 |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
6 # Remove 'myHub.zip at root folder |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
7 try: |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
8 os.remove('myHub.zip') |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
9 except OSError as o: |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
10 # We don't need to crash the program |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
11 print 'Warning: ' + str(o) |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
12 |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
13 # Remove 'myHub' folder and its content |
|
abcfd662b679
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff
changeset
|
14 shutil.rmtree('myHub', ignore_errors=True) |
