From f6c09a737f8dbbf3f3ed56de9e10679c7e31acda Mon Sep 17 00:00:00 2001 From: Jeffrey Forman Date: Mon, 31 Dec 2012 13:13:28 -0500 Subject: [PATCH] Add quick script to check binder dependencies. Mostly python modules --- check-dependencies.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 check-dependencies.py diff --git a/check-dependencies.py b/check-dependencies.py new file mode 100755 index 0000000..3103797 --- /dev/null +++ b/check-dependencies.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +"""Script to verify required/optional dependencies are installed.""" + +import sys +errors = 0 + +try: + import BeautifulSoup +except ImportError: + print "Could not import BeautifulSoup. This is a required module for Binder.\n" + errors += 1 + +try: + import django +except ImportError: + print "Could not import Django. This is a required package for Binder.\n" + errors += 1 + +try: + import dns +except ImportError: + print "Could not import dns. This is a required module for Binder." + print "Package is typically called 'python-dnspython.'\n" + errors += 1 + +try: + import flup +except ImportError: + print "Could not import flup. This is an optional module if you intend to run Binder under fastcgi." + print "Package is typically called 'python-flup.'\n" + +if errors: + print "Critical missing packages found: %d.\n" % errors + sys.exit(errors) +else: + print "All required packages found!"