swc-installation-test.py: Add installation-testing script

The content of this script was posted by Greg Wilson and attributed to
Konrad Hinsen [1].

[1]: https://github.com/swcarpentry/website/issues/38#issuecomment-11189525
workshop_checklist.py: Add installation-testing script

This script was linked to by Eric Bray [1] and hosted on Fernando
Perez's website [2].

[1]: https://github.com/swcarpentry/website/issues/38#issuecomment-11386945
[2]: http://fperez.org/py4science/workshop_checklist.py
Merge Konrad Hinsen and Fernando Perez's installation-testing scripts
swc-installation-test: Consolidate and reorganize test scripts
swc-installation-test-2.py: sort CHECKS into topics
swc-installation-test-2.py: Add some editors and browsers

Based on a list of possibilities mentioned by Cait Pickens in an
internal email.
swc-installation-test-2.py: Add virtual-editor and virtual-browser

Often we don't care which editor is installed, so long as at least one
is installed.  This commit tweaks Dependency and adds a
VirtualDependency class to support such virtual dependencies.  You
can't get very fancy with boolean logic, but an all-and and all-or
lists will probably be sufficient for our needs.
swc-installation-test-2.py: Add exe_extension for MS Windows compat.

Use distutils' new_compiler() to get the appropriate exe_extension for
the user's system.  This way command names can always be specified in
their bare form, and we'll automatically add the right executable
extension for other platforms.
swc-installation-test-2.py: `PythonDependency`s should depend on Python
swc-installation-test-2.py: Cache check errors

Avoid running the same check (e.g. 'python') over and over.
swc-installation-test-2.py: Don't print duplicate exceptions

For example, if you have an outdated 'python', you only want to hear
about that once, not once for each PythonPackageDependency.
swc-installation-test-2.py: Print successfully-found versions

This makes it easy to see what a user has installed.
swc-installation-test-2.py: Don't chain exceptions (yet)

Exception chaining (PEP 3134, 'raise ... from') raises SyntaxErros in
Python 2.x.  Comment the chaining out until SWC starts teaching only
Python 3.x.
swc-installation-test-2.py: import print_function for Python 2.6

Otherwise `print()` actually prints `()`, where we want it to print a
blank line.
swc-installation-test-2.py: Don't parse missing versions
swc-installation-test-2.py: Add import_module for older Pythons

importlib is new in Python 2.7 / 3.1.  Add a minimal workaround for
earlier versions.
swc-installation-test-2.py: Refactor PythonPackageDependency._get_version

Split it into pieces for easier subclassing.
swc-installation-test-2.py: Fix 'mercurial' version extraction

The Mercurial Python package stores its version in strange places.
swc-installation-test-2.py: Fix version extraction for sqlite3-python

The 'sqlite3' package has the same version as the standard library.
We only check for it because sometimes (e.g. on Gentoo) Python may be
compiled without this package.
swc-installation-test-2.py: Don't require a specific Bash version

I have access to a machine running OS X 10.6.8, which has:

  $ bash --version
  GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)
  Copyright (C) 2007 Free Software Foundation, Inc.

That means no associative arrays, but for SWC purposes, it should
still get the job done.  All we really need is POSIX.2.