1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-26 12:12:11 +01:00

Merge pull request #479 from lethliel/python3_cmdln_module

[python3] enable full python3 support for man page building
This commit is contained in:
Marco Strigl 2019-04-15 15:02:19 +02:00 committed by GitHub
commit 5e6bcf5610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -621,16 +621,16 @@ class RawCmdln(cmd.Cmd):
${name} man ${name} man
""" """
mandate = datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) mandate = datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
self.stdout.write(bytes( self.stdout.write(
self.man_header % { self.man_header % {
'date': mandate.strftime('%b %Y'), 'date': mandate.strftime('%b %Y'),
'version': self.get_version(), 'version': self.get_version(),
'name': self.name, 'name': self.name,
'ucname': self.name.upper() 'ucname': self.name.upper()
}, }
"utf-8")) )
self.stdout.write(bytes(self.man_commands_header, "utf-8")) self.stdout.write(self.man_commands_header)
commands = self._help_get_command_list() commands = self._help_get_command_list()
for command, doc in commands: for command, doc in commands:
cmdname = command.split(' ')[0] cmdname = command.split(' ')[0]
@ -641,14 +641,14 @@ class RawCmdln(cmd.Cmd):
line = line[8:] line = line[8:]
lines.append(man_escape(line)) lines.append(man_escape(line))
self.stdout.write(bytes( self.stdout.write(
'.TP\n\\fB%s\\fR\n%s\n' % (command, '\n'.join(lines)), "utf-8")) '.TP\n\\fB%s\\fR\n%s\n' % (command, '\n'.join(lines)))
self.stdout.write(bytes(self.man_options_header, "utf-8")) self.stdout.write(self.man_options_header)
self.stdout.write(bytes( self.stdout.write(
man_escape(self._help_preprocess('${option_list}', None)), "utf-8")) man_escape(self._help_preprocess('${option_list}', None)))
self.stdout.write(bytes(self.man_footer, "utf-8")) self.stdout.write(self.man_footer)
self.stdout.flush() self.stdout.flush()