diff options
author | Adam Sampson <ats@offog.org> | 2014-11-25 10:41:49 +0100 |
---|---|---|
committer | Adam Sampson <ats@offog.org> | 2014-11-25 10:41:49 +0100 |
commit | f6f10f7516b475fde36a32bd3e55067cb18cbe76 (patch) | |
tree | c0b203309dc4e86a766f4e5d13867b7c7c8d0a4d | |
parent | 571c41004d6cb9e6ae5a0820778596ae22096719 (diff) | |
download | logilab-common-f6f10f7516b475fde36a32bd3e55067cb18cbe76.tar.gz |
[configuration] fix print calls
This file uses the Python 3-style print function, so >> won't work.
-rw-r--r-- | configuration.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/configuration.py b/configuration.py index 1371c76..b292427 100644 --- a/configuration.py +++ b/configuration.py @@ -409,21 +409,20 @@ def rest_format_section(stream, section, options, encoding=None, doc=None): """format an options section using as ReST formatted output""" encoding = _get_encoding(encoding, stream) if section: - print >> stream, '%s\n%s' % (section, "'"*len(section)) + print('%s\n%s' % (section, "'"*len(section)), file=stream) if doc: - print >> stream, _encode(normalize_text(doc, line_len=79, indent=''), - encoding) - print >> stream + print(_encode(normalize_text(doc, line_len=79, indent=''), encoding), file=stream) + print(file=stream) for optname, optdict, value in options: help = optdict.get('help') - print >> stream, ':%s:' % optname + print(':%s:' % optname, file=stream) if help: help = normalize_text(help, line_len=79, indent=' ') - print >> stream, _encode(help, encoding) + print(_encode(help, encoding), file=stream) if value: value = _encode(format_option_value(optdict, value), encoding) - print >> stream, '' - print >> stream, ' Default: ``%s``' % value.replace("`` ", "```` ``") + print(file=stream) + print(' Default: ``%s``' % value.replace("`` ", "```` ``"), file=stream) # Options Manager ############################################################## |