Mercurial > repos > yating-l > hubarchivecreatortest
annotate util/cleanDirectory.py @ 3:fa990284327b draft default tip
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit ac73da32d59853ca563e7939d05016a6f3a6899e-dirty
| author | yating-l |
|---|---|
| date | Mon, 30 Oct 2017 11:58:31 -0400 |
| parents | 85195e0d4b71 |
| children |
| rev | line source |
|---|---|
|
1
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
1 #!/usr/bin/python |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
2 """Use to clean the directory after the run of HubArchiveCreator.py manually""" |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
3 import os |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
4 import shutil |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
5 |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
6 # Remove 'myHub.zip at root folder |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
7 try: |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
8 os.remove('myHub.zip') |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
9 except OSError as o: |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
10 # We don't need to crash the program |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
11 print 'Warning: ' + str(o) |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
12 |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
13 # Remove 'myHub' folder and its content |
|
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
yating-l
parents:
diff
changeset
|
14 shutil.rmtree('myHub', ignore_errors=True) |
