Mercurial > repos > yating-l > hubarchivecreator
annotate __init__.py @ 34:04b942019dce draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit e42ecb807fb34a8e4ddcf96944dd74d24c695352-dirty
| author | yating-l | 
|---|---|
| date | Thu, 29 Dec 2016 17:57:51 -0500 | 
| 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 # Set default logging handler to avoid "No handler found" warnings. | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 2 import logging | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 3 import sys | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 4 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 5 try: # Python 2.7+ | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 6 from logging import NullHandler | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 7 except ImportError: | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 8 class NullHandler(logging.Handler): | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 9 def emit(self, record): | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 10 pass | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 11 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 12 logging.getLogger(__name__).addHandler(NullHandler()) | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 13 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 14 log_stdout = None | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 15 log_stderr = None | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 16 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 17 | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 18 # TODO: Handle the Exception by dispatching the error depending on the (debug) mode | 
| 
3e0c61b52a06
planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty
 yating-l parents: diff
changeset | 19 #class Exception(Exception): | 
