Initial port to python3
[htsworkflow.git] / htsworkflow / util / fctracker.py
index 5ba33892f741213bb1932292e5821551df379295..8ff8967fae872aae7d514ac9796f59d02e79868f 100644 (file)
@@ -57,7 +57,7 @@ class fctracker:
         # extract just the field name
         description = [ f[0] for f in c.description]
         for row in c:
-            row_dict = dict(zip(description, row))
+            row_dict = dict(list(zip(description, row)))
             table[row_dict[pkey_name]] = row_dict
         c.close()
         return table
@@ -68,11 +68,11 @@ class fctracker:
         """
         library_id_re = re.compile('lane_\d_library_id')
 
-        for fc_id, fc in self.flowcells.items():
-            lane_library = [ (x[0][5], x[1]) for x in fc.items(
+        for fc_id, fc in list(self.flowcells.items()):
+            lane_library = [ (x[0][5], x[1]) for x in list(fc.items()
                                              if library_id_re.match(x[0]) ]
             for lane, library_id in lane_library:
-                if not self.library[library_id].has_key('lanes'):
+                if 'lanes' not in self.library[library_id]:
                     self.library[library_id]['lanes'] = []
                 self.library[library_id]['lanes'].append((fc_id, lane))
 
@@ -110,7 +110,7 @@ class fctracker:
         # extract just the field name
         description = [ f[0] for f in c.description ]
         for row in c:
-            row_dict = dict(zip(description, row))
+            row_dict = dict(list(zip(description, row)))
             fcid, status = self._parse_flowcell_id(row_dict)
             row_dict['flowcell_id'] = fcid
             row_dict['flowcell_status'] = status
@@ -173,7 +173,7 @@ def recoverable_drive_report(flowcells):
 
     # sort flowcells by run date
     flowcell_list = []
-    for key, cell in flowcells.items():
+    for key, cell in list(flowcells.items()):
         flowcell_list.append( (cell['run_date'], key) )
     flowcell_list.sort()