summaryrefslogtreecommitdiff
path: root/baserockimport/exts/python.to_lorry
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2015-01-08 10:48:52 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-01-08 10:48:52 +0000
commit5dfbc39b70b87dfe19d53142967c5ad40b55fe75 (patch)
tree88883f98ae99c3217fe9b461fb5db33d4a03c9b1 /baserockimport/exts/python.to_lorry
parentbad7aca19f7068cb91df848d9387bb80c83ff198 (diff)
downloadimport-5dfbc39b70b87dfe19d53142967c5ad40b55fe75.tar.gz
Pass local_data_path to python exts through argvbaserock/richardipsum/fix-lorry-bug-2
Diffstat (limited to 'baserockimport/exts/python.to_lorry')
-rwxr-xr-xbaserockimport/exts/python.to_lorry7
1 files changed, 5 insertions, 2 deletions
diff --git a/baserockimport/exts/python.to_lorry b/baserockimport/exts/python.to_lorry
index f54e341..48367fb 100755
--- a/baserockimport/exts/python.to_lorry
+++ b/baserockimport/exts/python.to_lorry
@@ -188,16 +188,19 @@ def str_repo_lorry(package_name, repo_type, url):
indent=4, sort_keys=True)
def main(argv):
- if len(argv) != 2:
+ if len(argv) not in [2, 3]:
# 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' % argv[0], file=sys.stderr)
+ print('usage: %s requirement [local_data_path]' % argv[0], file=sys.stderr)
sys.exit(1)
client = xmlrpclib.ServerProxy(PYPI_URL)
req = pkg_resources.parse_requirements(argv[1]).next()
+ local_data_path = argv[2] if len(argv) == 3 else None
+
+ logging.debug('local_data_path to_lorry: %s\n', local_data_path)
new_proj_name = name_or_closest(client, req.project_name)