Mercurial > repos > yating-l > hubarchivecreator
annotate util/cleanDirectory.py @ 72:2440ce10848b draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit a60f8496cccf4c5a07ba7d75876198eda997f07d
| author | yating-l | 
|---|---|
| date | Wed, 27 Sep 2017 15:34:20 -0400 | 
| parents | 3e0c61b52a06 | 
| children | 
| rev | line source | 
|---|---|
| 0 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 1 #!/usr/bin/python | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 2 """Use to clean the directory after the run of HubArchiveCreator.py manually""" | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 3 import os | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 4 import shutil | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 5 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 6 # Remove 'myHub.zip at root folder | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 7 try: | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 8 os.remove('myHub.zip') | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 9 except OSError as o: | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 10 # We don't need to crash the program | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 11 print 'Warning: ' + str(o) | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 12 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 13 # Remove 'myHub' folder and its content | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 14 shutil.rmtree('myHub', ignore_errors=True) | 
