summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2022-11-11 17:52:35 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2022-11-11 17:52:35 +0100
commitf65346fd57df6a23b5ab3ed661d425efe37cbd2a (patch)
tree1f1f7879357f707a9dfd197822a791f4254ef40b
parentc0aadb18038f2ce29dbdd9cc11be072b15fd34eb (diff)
downloadpsutil-f65346fd57df6a23b5ab3ed661d425efe37cbd2a.tar.gz
use argparse module in 3 scripts/internal scripts
-rwxr-xr-xscripts/internal/print_wheels.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/internal/print_wheels.py b/scripts/internal/print_wheels.py
index 5e5faccd..6b19909b 100755
--- a/scripts/internal/print_wheels.py
+++ b/scripts/internal/print_wheels.py
@@ -6,6 +6,7 @@
"""Nicely print wheels print in dist/ directory."""
+import argparse
import collections
import glob
import os
@@ -67,8 +68,15 @@ class Wheel:
def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('dir', nargs="?", default="dist",
+ help='directory containing tar.gz or wheel files')
+ args = parser.parse_args()
+
+ if not os.path.isdir(args.dir):
+ raise NotADirectoryError(args.dir)
groups = collections.defaultdict(list)
- for path in glob.glob('dist/*.whl'):
+ for path in glob.glob('%s/*.whl' % args.dir):
wheel = Wheel(path)
groups[wheel.platform()].append(wheel)