From 5df51d36fcfad7448cbc519fce824dbebcdf13fa Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 29 Jan 2015 10:26:27 -0800 Subject: [PATCH] convert to print_function --- htsworkflow/pipelines/bustard.py | 14 ++++++++------ htsworkflow/pipelines/eland.py | 4 +++- htsworkflow/pipelines/firecrest.py | 11 ++++++----- htsworkflow/pipelines/gerald.py | 10 ++++++---- htsworkflow/pipelines/ipar.py | 8 +++++--- htsworkflow/pipelines/srf.py | 1 - htsworkflow/pipelines/summary.py | 4 +++- 7 files changed, 31 insertions(+), 21 deletions(-) diff --git a/htsworkflow/pipelines/bustard.py b/htsworkflow/pipelines/bustard.py index 99f231d..5df79c7 100644 --- a/htsworkflow/pipelines/bustard.py +++ b/htsworkflow/pipelines/bustard.py @@ -4,6 +4,8 @@ Extract configuration from Illumina Bustard Directory. 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 @@ -289,7 +291,7 @@ class Bustard(object): 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): @@ -456,22 +458,22 @@ def main(cmdline): 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()) - print ('-------------------------------------') + print('-------------------------------------') 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: - print "b1: ", b1 - print "b2: ", b2 + print("b1: ", b1) + print("b2: ", b2) if __name__ == "__main__": main(sys.argv[1:]) diff --git a/htsworkflow/pipelines/eland.py b/htsworkflow/pipelines/eland.py index a508a49..acc805a 100644 --- a/htsworkflow/pipelines/eland.py +++ b/htsworkflow/pipelines/eland.py @@ -1,6 +1,8 @@ """ Analyze ELAND files """ +from __future__ import print_function + 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) - print ElementTree.tostring(e.get_elements()) + print(ElementTree.tostring(e.get_elements())) return diff --git a/htsworkflow/pipelines/firecrest.py b/htsworkflow/pipelines/firecrest.py index 3519eb0..11c1d4c 100644 --- a/htsworkflow/pipelines/firecrest.py +++ b/htsworkflow/pipelines/firecrest.py @@ -9,6 +9,7 @@ fromxml 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 @@ -66,11 +67,11 @@ class Firecrest(object): 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. diff --git a/htsworkflow/pipelines/gerald.py b/htsworkflow/pipelines/gerald.py index dd70fe2..d1a40bd 100644 --- a/htsworkflow/pipelines/gerald.py +++ b/htsworkflow/pipelines/gerald.py @@ -1,5 +1,7 @@ """Provide access to information stored in the GERALD directory. """ +from __future__ import print_function + import collections from datetime import datetime, date import logging @@ -59,10 +61,10 @@ class Alignment(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): diff --git a/htsworkflow/pipelines/ipar.py b/htsworkflow/pipelines/ipar.py index 6c3acbe..46758ec 100644 --- a/htsworkflow/pipelines/ipar.py +++ b/htsworkflow/pipelines/ipar.py @@ -9,6 +9,8 @@ fromxml IPAR factory function initalized from an xml dump from the IPAR object. """ +from __future__ import print_function + __docformat__ = "restructuredtext en" import datetime @@ -159,7 +161,7 @@ class IPAR(object): """ 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 = [] @@ -172,8 +174,8 @@ class IPAR(object): 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) } diff --git a/htsworkflow/pipelines/srf.py b/htsworkflow/pipelines/srf.py index 03b96b8..2663ee3 100644 --- a/htsworkflow/pipelines/srf.py +++ b/htsworkflow/pipelines/srf.py @@ -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)) - print seq_cmds srf.run_commands(args.source, seq_cmds, num_jobs) def make_parser(): diff --git a/htsworkflow/pipelines/summary.py b/htsworkflow/pipelines/summary.py index 100b2c0..1da11a3 100644 --- a/htsworkflow/pipelines/summary.py +++ b/htsworkflow/pipelines/summary.py @@ -1,6 +1,8 @@ """ Analyze the Summary.htm file produced by GERALD """ +from __future__ import print_function + import os import logging import re @@ -67,7 +69,7 @@ class Summary(object): 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): -- 2.30.2