Initial port to python3
[htsworkflow.git] / htsworkflow / pipelines / run_status.py
index e6a3ed8e6b2f41793f1109dac1334900860e8eaf..0903e7018f7760aa43fafeb3289c7194ebd0d9d6 100644 (file)
@@ -78,7 +78,7 @@ def _p2f(pattern, lane, tile=None, cycle=None):
   # lane, and cycle provided (INVALID)
   if tile is None and cycle is not None:
     msg = "Handling of cycle without tile is not currently implemented."
-    raise ValueError, msg
+    raise ValueError(msg)
 
   # lane, tile, cycle provided
   elif cycle:
@@ -299,7 +299,7 @@ class GARunStatus(object):
     """
     firecrest = self.status['firecrest']
     total = len(firecrest)
-    completed = firecrest.values().count(True)
+    completed = list(firecrest.values()).count(True)
 
     return (completed, total)
 
@@ -310,7 +310,7 @@ class GARunStatus(object):
     """
     bustard = self.status['bustard']
     total = len(bustard)
-    completed = bustard.values().count(True)
+    completed = list(bustard.values()).count(True)
 
     return (completed, total)
 
@@ -321,7 +321,7 @@ class GARunStatus(object):
     """
     gerald = self.status['gerald']
     total = len(gerald)
-    completed = gerald.values().count(True)
+    completed = list(gerald.values()).count(True)
 
     return (completed, total)
 
@@ -410,13 +410,13 @@ def _cmdLineStatusMonitorFunc(conf_info):
 
   while 1:
     if conf_info.status is None:
-      print "No status object yet."
+      print("No status object yet.")
       time.sleep(SLEEP_AMOUNT)
       continue
 
     report = conf_info.status.statusReport()
-    print os.linesep.join(report)
-    print
+    print(os.linesep.join(report))
+    print()
 
     time.sleep(SLEEP_AMOUNT)
 
@@ -446,7 +446,7 @@ def main(cmdline=None):
     parser.error("need name of configuration file")
     
   status = GARunStatus(args[0])
-  print os.linesep.join(status.statusReport())
+  print(os.linesep.join(status.statusReport()))
   return 0
 
 if __name__ == "__main__":