diff options
| author | Alex Grönholm <alex.gronholm@nextday.fi> | 2021-12-24 01:27:26 +0200 |
|---|---|---|
| committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2021-12-24 01:45:01 +0200 |
| commit | 5eb690c72ea59bc0f8a2fa34d3993ebe3dbe0d38 (patch) | |
| tree | dff2a2103314f0fe6c5cc53b91a120f59edf78d3 /src/wheel/cli/__init__.py | |
| parent | 64d0b8d779b5b41bacea2ef3b59f3e06f0e683ed (diff) | |
| download | wheel-git-5eb690c72ea59bc0f8a2fa34d3993ebe3dbe0d38.tar.gz | |
Adopted black and reformatted the codebase to match
Diffstat (limited to 'src/wheel/cli/__init__.py')
| -rw-r--r-- | src/wheel/cli/__init__.py | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/src/wheel/cli/__init__.py b/src/wheel/cli/__init__.py index c8a3b35..31ac4c8 100644 --- a/src/wheel/cli/__init__.py +++ b/src/wheel/cli/__init__.py @@ -20,21 +20,25 @@ class WheelError(Exception): def unpack_f(args): from .unpack import unpack + unpack(args.wheelfile, args.dest) def pack_f(args): from .pack import pack + pack(args.directory, args.dest_dir, args.build_number) def convert_f(args): from .convert import convert + convert(args.files, args.dest_dir, args.verbose) def version_f(args): from .. import __version__ + print("wheel %s" % __version__) @@ -42,30 +46,41 @@ def parser(): p = argparse.ArgumentParser() s = p.add_subparsers(help="commands") - unpack_parser = s.add_parser('unpack', help='Unpack wheel') - unpack_parser.add_argument('--dest', '-d', help='Destination directory', - default='.') - unpack_parser.add_argument('wheelfile', help='Wheel file') + unpack_parser = s.add_parser("unpack", help="Unpack wheel") + unpack_parser.add_argument( + "--dest", "-d", help="Destination directory", default="." + ) + unpack_parser.add_argument("wheelfile", help="Wheel file") unpack_parser.set_defaults(func=unpack_f) - repack_parser = s.add_parser('pack', help='Repack wheel') - repack_parser.add_argument('directory', help='Root directory of the unpacked wheel') - repack_parser.add_argument('--dest-dir', '-d', default=os.path.curdir, - help="Directory to store the wheel (default %(default)s)") - repack_parser.add_argument('--build-number', help="Build tag to use in the wheel name") + repack_parser = s.add_parser("pack", help="Repack wheel") + repack_parser.add_argument("directory", help="Root directory of the unpacked wheel") + repack_parser.add_argument( + "--dest-dir", + "-d", + default=os.path.curdir, + help="Directory to store the wheel (default %(default)s)", + ) + repack_parser.add_argument( + "--build-number", help="Build tag to use in the wheel name" + ) repack_parser.set_defaults(func=pack_f) - convert_parser = s.add_parser('convert', help='Convert egg or wininst to wheel') - convert_parser.add_argument('files', nargs='*', help='Files to convert') - convert_parser.add_argument('--dest-dir', '-d', default=os.path.curdir, - help="Directory to store wheels (default %(default)s)") - convert_parser.add_argument('--verbose', '-v', action='store_true') + convert_parser = s.add_parser("convert", help="Convert egg or wininst to wheel") + convert_parser.add_argument("files", nargs="*", help="Files to convert") + convert_parser.add_argument( + "--dest-dir", + "-d", + default=os.path.curdir, + help="Directory to store wheels (default %(default)s)", + ) + convert_parser.add_argument("--verbose", "-v", action="store_true") convert_parser.set_defaults(func=convert_f) - version_parser = s.add_parser('version', help='Print version and exit') + version_parser = s.add_parser("version", help="Print version and exit") version_parser.set_defaults(func=version_f) - help_parser = s.add_parser('help', help='Show this help') + help_parser = s.add_parser("help", help="Show this help") help_parser.set_defaults(func=lambda args: p.print_help()) return p @@ -74,7 +89,7 @@ def parser(): def main(): p = parser() args = p.parse_args() - if not hasattr(args, 'func'): + if not hasattr(args, "func"): p.print_help() else: try: |
