diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-01-08 10:32:56 +0000 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-01-08 10:32:56 +0000 |
commit | bad7aca19f7068cb91df848d9387bb80c83ff198 (patch) | |
tree | c80e11c1c3bb7d3afc64b4f64255d5d609a35fe0 /baserockimport/exts/python.to_lorry | |
parent | 12ec2e4efe868d990076ed8b4e7376c3e808b38e (diff) | |
download | import-bad7aca19f7068cb91df848d9387bb80c83ff198.tar.gz |
Pass argv into main of each extension
This allows us to more simply modify argv before running the extensions
Diffstat (limited to 'baserockimport/exts/python.to_lorry')
-rwxr-xr-x | baserockimport/exts/python.to_lorry | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/baserockimport/exts/python.to_lorry b/baserockimport/exts/python.to_lorry index accc9dc..f54e341 100755 --- a/baserockimport/exts/python.to_lorry +++ b/baserockimport/exts/python.to_lorry @@ -187,17 +187,17 @@ def str_repo_lorry(package_name, repo_type, url): return json.dumps({name: {'type': repo_type, 'url': url}}, indent=4, sort_keys=True) -def main(): - if len(sys.argv) != 2: +def main(argv): + if len(argv) != 2: # TODO explain the format of python requirements # warn the user that they probably want to quote their arg # > < will be interpreted as redirection by the shell - print('usage: %s requirement' % sys.argv[0], file=sys.stderr) + print('usage: %s requirement' % argv[0], file=sys.stderr) sys.exit(1) client = xmlrpclib.ServerProxy(PYPI_URL) - req = pkg_resources.parse_requirements(sys.argv[1]).next() + req = pkg_resources.parse_requirements(argv[1]).next() new_proj_name = name_or_closest(client, req.project_name) |