convert to print_function
authorDiane Trout <diane@ghic.org>
Thu, 29 Jan 2015 18:26:27 +0000 (10:26 -0800)
committerDiane Trout <diane@ghic.org>
Thu, 29 Jan 2015 18:46:51 +0000 (10:46 -0800)
htsworkflow/pipelines/bustard.py
htsworkflow/pipelines/eland.py
htsworkflow/pipelines/firecrest.py
htsworkflow/pipelines/gerald.py
htsworkflow/pipelines/ipar.py
htsworkflow/pipelines/srf.py
htsworkflow/pipelines/summary.py

index 99f231dd73e748a0c88b528f4489968ab20b8428..5df79c7fb80eb3afd5cba76f536e6c194a39d533 100644 (file)
@@ -4,6 +4,8 @@ Extract configuration from Illumina Bustard Directory.
 This includes the version number, run date, bustard executable parameters, and
 phasing estimates.
 """
 This includes the version number, run date, bustard executable parameters, and
 phasing estimates.
 """
+from __future__ import print_function
+
 from copy import copy
 from datetime import date
 from glob import glob
 from copy import copy
 from datetime import date
 from glob import glob
@@ -289,7 +291,7 @@ class Bustard(object):
     time = property(_get_time, doc='return run time as seconds since epoch')
 
     def dump(self):
     time = property(_get_time, doc='return run time as seconds since epoch')
 
     def dump(self):
-        #print ElementTree.tostring(self.get_elements())
+        #print(ElementTree.tostring(self.get_elements()))
         ElementTree.dump(self.get_elements())
 
     def get_elements(self):
         ElementTree.dump(self.get_elements())
 
     def get_elements(self):
@@ -456,22 +458,22 @@ def main(cmdline):
     opts, args = parser.parse_args(cmdline)
 
     for bustard_dir in args:
     opts, args = parser.parse_args(cmdline)
 
     for bustard_dir in args:
-        print u'analyzing bustard directory: ' + unicode(bustard_dir)
+        print(u'analyzing bustard directory: ' + unicode(bustard_dir))
         bustard_object = bustard(bustard_dir)
         bustard_object.dump()
 
         bustard_object2 = Bustard(xml=bustard_object.get_elements())
         bustard_object = bustard(bustard_dir)
         bustard_object.dump()
 
         bustard_object2 = Bustard(xml=bustard_object.get_elements())
-        print ('-------------------------------------')
+        print('-------------------------------------')
         bustard_object2.dump()
         bustard_object2.dump()
-        print ('=====================================')
+        print('=====================================')
         b1_tree = bustard_object.get_elements()
         b1 = ElementTree.tostring(b1_tree).split(os.linesep)
         b2_tree = bustard_object2.get_elements()
         b2 = ElementTree.tostring(b2_tree).split(os.linesep)
         for line1, line2 in zip(b1, b2):
             if b1 != b2:
         b1_tree = bustard_object.get_elements()
         b1 = ElementTree.tostring(b1_tree).split(os.linesep)
         b2_tree = bustard_object2.get_elements()
         b2 = ElementTree.tostring(b2_tree).split(os.linesep)
         for line1, line2 in zip(b1, b2):
             if b1 != b2:
-                print "b1: ", b1
-                print "b2: ", b2
+                print("b1: ", b1)
+                print("b2: ", b2)
 
 if __name__ == "__main__":
     main(sys.argv[1:])
 
 if __name__ == "__main__":
     main(sys.argv[1:])
index a508a494c8c24900e8574c75f43c3616bf309814..acc805a889d3000ffbe4a1f73cedec2930e47bbf 100644 (file)
@@ -1,6 +1,8 @@
 """
 Analyze ELAND files
 """
 """
 Analyze ELAND files
 """
+from __future__ import print_function
+
 import collections
 from glob import glob
 import logging
 import collections
 from glob import glob
 import logging
@@ -895,7 +897,7 @@ def main(cmdline=None):
     for a in args:
         LOGGER.info("Starting scan of %s" % (a,))
         e = eland(a)
     for a in args:
         LOGGER.info("Starting scan of %s" % (a,))
         e = eland(a)
-        print ElementTree.tostring(e.get_elements())
+        print(ElementTree.tostring(e.get_elements()))
     return
 
 
     return
 
 
index 3519eb0123600ef99602cccb25210d119a62a073..11c1d4cb9f0642d8e5d9ffc556ca0e1c4c354435 100644 (file)
@@ -9,6 +9,7 @@ fromxml
   Firecrest factory function initalized from an xml dump from
   the Firecrest object.
 """
   Firecrest factory function initalized from an xml dump from
   the Firecrest object.
 """
+from __future__ import print_function
 
 from datetime import date
 from glob import glob
 
 from datetime import date
 from glob import glob
@@ -66,11 +67,11 @@ class Firecrest(object):
     def dump(self):
         """Report debugginf information
         """
     def dump(self):
         """Report debugginf information
         """
-        print "Starting cycle:", self.start
-        print "Ending cycle:", self.stop
-        print "Firecrest version:", self.version
-        print "Run date:", self.date
-        print "user:", self.user
+        print("Starting cycle:", self.start)
+        print("Ending cycle:", self.stop)
+        print("Firecrest version:", self.version)
+        print("Run date:", self.date)
+        print("user:", self.user)
 
     def get_elements(self):
         """Return XML serialization structure.
 
     def get_elements(self):
         """Return XML serialization structure.
index dd70fe262bbed816e0d0ed38c9ab793dca79281e..d1a40bdb408897a271ffaeb87f753f2aab468f61 100644 (file)
@@ -1,5 +1,7 @@
 """Provide access to information stored in the GERALD directory.
 """
 """Provide access to information stored in the GERALD directory.
 """
+from __future__ import print_function
+
 import collections
 from datetime import datetime, date
 import logging
 import collections
 from datetime import datetime, date
 import logging
@@ -59,10 +61,10 @@ class Alignment(object):
         """
         Debugging function, report current object
         """
         """
         Debugging function, report current object
         """
-        print 'Software:'. self.__class__.__name__
-        print 'Alignment version:', self.version
-        print 'Run date:', self.date
-        print 'config.xml:', self.tree
+        print('Software:'. self.__class__.__name__)
+        print('Alignment version:', self.version)
+        print('Run date:', self.date)
+        print('config.xml:', self.tree)
         self.summary.dump()
 
     def get_elements(self, root_tag):
         self.summary.dump()
 
     def get_elements(self, root_tag):
index 6c3acbe19b50c8959b5deb011e36eb9cf7396212..46758ec141af2629838e439ce0747642d8f024e6 100644 (file)
@@ -9,6 +9,8 @@ fromxml
     IPAR factory function initalized from an xml dump from
     the IPAR object.
 """
     IPAR factory function initalized from an xml dump from
     the IPAR object.
 """
+from __future__ import print_function
+
 __docformat__ = "restructuredtext en"
 
 import datetime
 __docformat__ = "restructuredtext en"
 
 import datetime
@@ -159,7 +161,7 @@ class IPAR(object):
         """
         suffix_node = self.tree.find('RunParameters/CompressionSuffix')
         if suffix_node is None:
         """
         suffix_node = self.tree.find('RunParameters/CompressionSuffix')
         if suffix_node is None:
-          print "find compression suffix failed"
+          print("find compression suffix failed")
           return None
         suffix = suffix_node.text
         files = []
           return None
         suffix = suffix_node.text
         files = []
@@ -172,8 +174,8 @@ class IPAR(object):
         return files
 
     def dump(self):
         return files
 
     def dump(self):
-        print "Matrix:", self.matrix
-        print "Tree:", self.tree
+        print("Matrix:", self.matrix)
+        print("Tree:", self.tree)
 
     def get_elements(self):
         attribs = {'version': str(IPAR.XML_VERSION) }
 
     def get_elements(self):
         attribs = {'version': str(IPAR.XML_VERSION) }
index 03b96b8f35b481fddfb7f41100ed0366c2ef473f..2663ee39bd6453a02b4c9043d096e41e152171a7 100644 (file)
@@ -238,7 +238,6 @@ def main(cmdline=None):
         seq_cmds = make_srf_commands(opts.name, source, opts.lanes, opts.site_name, opts.destination, 0)
     else:
         raise ValueError('Unknown --format=%s' % (opts.format))
         seq_cmds = make_srf_commands(opts.name, source, opts.lanes, opts.site_name, opts.destination, 0)
     else:
         raise ValueError('Unknown --format=%s' % (opts.format))
-    print seq_cmds
     srf.run_commands(args.source, seq_cmds, num_jobs)
 
 def make_parser():
     srf.run_commands(args.source, seq_cmds, num_jobs)
 
 def make_parser():
index 100b2c0edcf7fd8cae1f48f679b7f673cc8a1c75..1da11a39b416f8141ca9f97c485d9477ed5dfbcb 100644 (file)
@@ -1,6 +1,8 @@
 """
 Analyze the Summary.htm file produced by GERALD
 """
 """
 Analyze the Summary.htm file produced by GERALD
 """
+from __future__ import print_function
+
 import os
 import logging
 import re
 import os
 import logging
 import re
@@ -67,7 +69,7 @@ class Summary(object):
         Debugging function, report current object
         """
         tree = self.get_elements()
         Debugging function, report current object
         """
         tree = self.get_elements()
-        print etree.tostring(tree)
+        print(etree.tostring(tree))
 
 class SummaryGA(Summary):
     def __init__(self, filename=None, xml=None):
 
 class SummaryGA(Summary):
     def __init__(self, filename=None, xml=None):