Replace some prints with logging.info messages and
[htsworkflow.git] / htsworkflow / pipelines / retrieve_config.py
index 13805c9514db7810f6c0c74671ff2c8afa424b6a..e9745a377fe2bed0c9a14789e630409b799e95c3 100644 (file)
@@ -128,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
 
@@ -150,7 +149,7 @@ def saveConfigFile(flowcell, base_host_url, output_filepath):
   try:
     web = urllib2.urlopen(url)
   except urllib2.URLError, e:
-    errmsg = 'URLError: %s' % (e.reason,)
+    errmsg = 'URLError: %d %s' % (e.code, e.msg)
     logging.error(errmsg)
     logging.error('opened %s' % (url,))
     raise IOError(errmsg)