summaryrefslogtreecommitdiff
path: root/optik_ext.py
diff options
context:
space:
mode:
authorRémi Cardona <remi.cardona@free.fr>2014-09-17 23:34:31 +0200
committerRémi Cardona <remi.cardona@free.fr>2014-09-17 23:34:31 +0200
commit30937b08ed70f51fa5785b419bda47f122157c3c (patch)
tree072cf154c24de1ae151d20093ca9a3cc64a140c3 /optik_ext.py
parentac2d15727c079fbc1d3fe6a606feef9c1179d2ce (diff)
downloadlogilab-common-30937b08ed70f51fa5785b419bda47f122157c3c.tar.gz
[py3k] print function
Requires python >= 2.6.
Diffstat (limited to 'optik_ext.py')
-rw-r--r--optik_ext.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/optik_ext.py b/optik_ext.py
index 7ba30bb..1fd2a7f 100644
--- a/optik_ext.py
+++ b/optik_ext.py
@@ -46,6 +46,8 @@ It also defines three new types for optik/optparse command line parser :
argument of this type will be converted to a float value in bytes
according to byte units (b, kb, mb, gb, tb)
"""
+from __future__ import print_function
+
__docformat__ = "restructuredtext en"
import re
@@ -381,9 +383,9 @@ def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout, level=0):
formatter = ManHelpFormatter()
formatter.output_level = level
formatter.parser = optparser
- print >> stream, formatter.format_head(optparser, pkginfo, section)
- print >> stream, optparser.format_option_help(formatter)
- print >> stream, formatter.format_tail(pkginfo)
+ print(formatter.format_head(optparser, pkginfo, section), file=stream)
+ print(optparser.format_option_help(formatter), file=stream)
+ print(formatter.format_tail(pkginfo), file=stream)
__all__ = ('OptionParser', 'Option', 'OptionGroup', 'OptionValueError',