3 # python swc_installation_test.py
5 # If if says nothing, everything is fine!
9 python_modules = ['nose']
12 ('easy_install', 'Python setuptools'),
15 ('nosetests', 'Python nose'),
18 # Check Python modules/packages
20 def check_python_modules(module_names):
21 for module_name in module_names:
23 __import__(module_name)
25 print "Python module '%s' is missing" % module_name
28 # Check command line tools
30 def check_command_line_tools(tools):
31 shell_path = os.environ['PATH'].split(':')
33 if isinstance(tool, basestring):
37 command, package = tool
39 for directory in shell_path:
40 filename = os.path.join(directory, command)
41 if os.access(filename, os.X_OK) and not os.path.isdir(filename):
46 print "Command line tool '%s' is missing" % command
48 print "Command line tool '%s' " \
49 "from package '%s' is missing" % (command, package)
55 check_python_modules(python_modules)
56 check_command_line_tools(tools)
59 if __name__ == '__main__':