Mercurial > repos > yating-l > hubarchivecreatortest
annotate util/cleanDirectory.py @ 1:85195e0d4b71 draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
| author | yating-l |
|---|---|
| date | Fri, 29 Sep 2017 13:32:23 -0400 |
| parents | |
| 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) |
