From 4615aefe242f5dbb49f3f2aff2844c5c98da91ea Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Thu, 6 Nov 2014 17:26:23 +0000 Subject: guard on main --- exts/pip_find_deps.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/exts/pip_find_deps.py b/exts/pip_find_deps.py index 3666afe..88391f9 100755 --- a/exts/pip_find_deps.py +++ b/exts/pip_find_deps.py @@ -230,16 +230,17 @@ def find_build_deps(source, name, version=None): return build_deps -if len(sys.argv) not in [3, 4]: - print('usage: %s PACKAGE_SOURCE_DIR NAME [VERSION]' % sys.argv[0]) - sys.exit(1) +if __name__ == '__main__': + if len(sys.argv) not in [3, 4]: + print('usage: %s PACKAGE_SOURCE_DIR NAME [VERSION]' % sys.argv[0]) + sys.exit(1) -# Ignore the issue of dependency conflicts for now + # Ignore the issue of dependency conflicts for now -# First, given a source return build dependencies in json from + # First, given a source return build dependencies in json from -for name, dep in find_build_deps(*sys.argv[1:]).iteritems(): - print('%s less_than: %s greater_than: %s absolute: %s excludes: %s' - % (name, str(dep.less_than), str(dep.greater_than), - str(dep.absolute), dep.excludes)) - print('conflicts: %s' % str(dep.conflicts)) \ No newline at end of file + for name, dep in find_build_deps(*sys.argv[1:]).iteritems(): + print('%s less_than: %s greater_than: %s absolute: %s excludes: %s' + % (name, str(dep.less_than), str(dep.greater_than), + str(dep.absolute), dep.excludes)) + print('conflicts: %s' % str(dep.conflicts)) -- cgit v1.2.1