From 5ee4984da586249fbb699e478a186c204254dde0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 13 May 2014 11:06:51 +0200 Subject: [PATCH] conf: print is a function in Python 3 --- conf/format-options.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/conf/format-options.py b/conf/format-options.py index 7d67c9890..5f850af00 100755 --- a/conf/format-options.py +++ b/conf/format-options.py @@ -230,32 +230,32 @@ class ConfFormatter: if len(opt.desc): self.__wrapper.initial_indent = '{0}# '.format(self.__indent * indent) self.__wrapper.subsequent_indent = self.__wrapper.initial_indent - print format(self.__wrapper.fill(self.__tags.replace(opt.desc[0]))) + print(self.__wrapper.fill(self.__tags.replace(opt.desc[0]))) def __print_option(self, opt, indent, commented): """Print a single option with description and default value""" comment = "# " if commented or opt.commented else "" self.__print_description(opt, indent) if opt.default: - print '{0}{1}{2} = {3}'.format(self.__indent * indent, comment, opt.name, opt.default) + print('{0}{1}{2} = {3}'.format(self.__indent * indent, comment, opt.name, opt.default)) else: - print '{0}{1}{2} ='.format(self.__indent * indent, comment, opt.name) - print + print('{0}{1}{2} ='.format(self.__indent * indent, comment, opt.name)) + print('') def __print_section(self, section, indent, commented): """Print a section with all options""" commented = commented or section.commented comment = "# " if commented else "" self.__print_description(section, indent) - print '{0}{1}{2} {{'.format(self.__indent * indent, comment, section.name) - print + print('{0}{1}{2} {{'.format(self.__indent * indent, comment, section.name)) + print('') for o in sorted(section.options, key=attrgetter('section')): if o.section: self.__print_section(o, indent + 1, commented) else: self.__print_option(o, indent + 1, commented) - print '{0}{1}}}'.format(self.__indent * indent, comment) - print + print('{0}{1}}}'.format(self.__indent * indent, comment)) + print('') def format(self, options): """Print a list of options""" @@ -286,14 +286,14 @@ class ManFormatter: if option.section and not len(option.desc): return if option.section: - print '.TP\n.B {0}\n.br'.format(option.fullname) + print('.TP\n.B {0}\n.br'.format(option.fullname)) else: - print '.TP' + print('.TP') default = option.default if option.default else '' - print '.BR {0} " [{1}]"'.format(option.fullname, default) + print('.BR {0} " [{1}]"'.format(option.fullname, default)) for para in option.desc if len(option.desc) < 2 else option.desc[1:]: - print self.__groffize(self.__wrapper.fill(para)) - print '' + print(self.__groffize(self.__wrapper.fill(para))) + print('') def format(self, options): """Print a list of options"""