mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 02:36:15 +01:00
[python3] enable full python3 support for man
This commit is contained in:
parent
7bd9ca485d
commit
67560887db
20
osc/cmdln.py
20
osc/cmdln.py
@ -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()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user