Ver Fonte

fix formatting

Antoine Beaupré há 9 anos atrás
pai
commit
45d9c6b3b7
1 ficheiros alterados com 5 adições e 12 exclusões
  1. 5 12
      setup.py

+ 5 - 12
setup.py

@@ -151,21 +151,14 @@ class build_usage(Command):
                 continue
                 continue
             with open('docs/usage/%s.rst.inc' % command, 'w') as cmdfile:
             with open('docs/usage/%s.rst.inc' % command, 'w') as cmdfile:
                 print('generating help for %s' % command)
                 print('generating help for %s' % command)
-                cmdfile.write(""".. _borg_{command}:
-
-borg {command}
-{underline}
-::
-
-""".format(**{"command": command,
-                              "underline": '-' * len('borg ' + command)}))
+                params = {"command": command,
+                          "underline": '-' * len('borg ' + command)}
+                cmdfile.write(".. _borg_{command}:\n\n".format(**params))
+                cmdfile.write("borg {command}\n{underline}\n::\n\n".format(**params))
                 epilog = parser.epilog
                 epilog = parser.epilog
                 parser.epilog = None
                 parser.epilog = None
                 cmdfile.write(re.sub("^", "    ", parser.format_help(), flags=re.M))
                 cmdfile.write(re.sub("^", "    ", parser.format_help(), flags=re.M))
-                cmdfile.write("""
-Description
-~~~~~~~~~~~
-""")
+                cmdfile.write("\nDescription\n~~~~~~~~~~~\n")
                 cmdfile.write(epilog)
                 cmdfile.write(epilog)