Initial port to python3
[htsworkflow.git] / htsworkflow / pipelines / configure_run.py
index 83c7569d2816b03e3a67a3fb4f376589ae472a5f..02d0adfc1619035a007849b0e7e4e24b81254e67 100644 (file)
@@ -243,7 +243,7 @@ def config_stdout_handler(line, conf_info):
 
     #Standard output handling
     else:
-      print 'Sequence line:', line
+      print('Sequence line:', line)
       mo = s_seq_folder.search(line)
       conf_info.bustard_path = line[mo.end():]
       conf_info.run_path, temp = os.path.split(conf_info.bustard_path)
@@ -377,16 +377,16 @@ def retrieve_config(conf_info, flowcell, cfg_filepath, genome_dir):
   try:
     saveConfigFile(flowcell, options.url, cfg_filepath)
     conf_info.config_filepath = cfg_filepath
-  except FlowCellNotFound, e:
+  except FlowCellNotFound as e:
     LOGGER.error(e)
     return False
-  except WebError404, e:
+  except WebError404 as e:
     LOGGER.error(e)
     return False
-  except IOError, e:
+  except IOError as e:
     LOGGER.error(e)
     return False
-  except Exception, e:
+  except Exception as e:
     LOGGER.error(e)
     return False
 
@@ -458,7 +458,7 @@ def configure(conf_info):
                            stdout=fout,
                            stderr=ferr)
 
-  print "Configuring pipeline: %s" % (time.ctime())
+  print("Configuring pipeline: %s" % (time.ctime()))
   error_code = pipe.wait()
 
   # Clean up
@@ -509,8 +509,8 @@ def configure(conf_info):
   # 1) The stdout completed without error
   # 2) The program exited with status 0
   # 3) No errors found in stdout
-  print '#Expect: True, False, True, True'
-  print complete, bool(error_code), abort != RUN_ABORT, stderr_success is True
+  print('#Expect: True, False, True, True')
+  print(complete, bool(error_code), abort != RUN_ABORT, stderr_success is True)
   status = complete is True and \
            bool(error_code) is False and \
            abort != RUN_ABORT and \
@@ -592,9 +592,9 @@ def run_pipeline(conf_info):
   ferr.close()
 
   # Finished file check!
-  print 'RUN SUCCESS CHECK:'
-  for key, value in event.run_status_dict.items():
-    print '  %s: %s' % (key, value)
+  print('RUN SUCCESS CHECK:')
+  for key, value in list(event.run_status_dict.items()):
+    print('  %s: %s' % (key, value))
 
   dstatus = event.run_status_dict