Replace some prints with logging.info messages and
[htsworkflow.git] / htsworkflow / pipelines / retrieve_config.py
index 380c0de1015b66d52195b21d45106a3bbf0000ef..e9745a377fe2bed0c9a14789e630409b799e95c3 100644 (file)
@@ -8,6 +8,8 @@ import os
 import sys
 import urllib2
 
+__docformat__ = "restructredtext en"
+
 CONFIG_SYSTEM = '/etc/hts_frontend/hts_frontend.conf'
 CONFIG_USER = os.path.expanduser('~/.hts_frontend.conf')
 
@@ -126,12 +128,11 @@ def getCombinedOptions():
     if conf_parser.has_option('local_setup', 'genome_dir'):
       options.genome_dir = conf_parser.get('local_setup', 'genome_dir')
   
-  print 'USING OPTIONS:'
-  print ' URL:', options.url
-  print ' OUT:', options.output_filepath
-  print '  FC:', options.flowcell
-  print 'GDIR:', options.genome_dir
-  print ''
+  logging.info('USING OPTIONS:')
+  logging.info(' URL: %s' % (options.url,))
+  logging.info(' OUT: %s' % (options.output_filepath,))
+  logging.info('  FC: %s' % (options.flowcell,))
+  logging.info('GDIR: %s' % (options.genome_dir,))
   
   return options
 
@@ -148,10 +149,9 @@ def saveConfigFile(flowcell, base_host_url, output_filepath):
   try:
     web = urllib2.urlopen(url)
   except urllib2.URLError, e:
-    errmsg = 'URLError: %d' % (e.code,)
+    errmsg = 'URLError: %d %s' % (e.code, e.msg)
     logging.error(errmsg)
     logging.error('opened %s' % (url,))
-    logging.error('%s' % ( e.read(),))
     raise IOError(errmsg)
 
   #except IOError, msg: