From: Tobias Brunner Date: Tue, 13 May 2014 09:06:51 +0000 (+0200) Subject: conf: print is a function in Python 3 X-Git-Tag: 5.2.0dr4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ee4984da586249fbb699e478a186c204254dde0;p=thirdparty%2Fstrongswan.git conf: print is a function in Python 3 --- diff --git a/conf/format-options.py b/conf/format-options.py index 7d67c9890a..5f850af00b 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"""