stbt batch report: Ignore invalid values in "extra-columns"

The extra-columns file can contain user-provided data (from the user's
pre-run, post-run, or classify hooks) so `stbt batch report` shouldn't
die because of an invalid value in one testrun (`stbt batch report`
reads the extra-columns information for every testrun, when generating
the summary html report).
stbt batch report: Show jpegs in testrun html view

`stbt batch run` doesn't generate jpegs, only pngs, but the user's
own test script, or pre- or post-run hooks, might do.
stbt batch report: Don't show "thumbnail.jpg" among test-run logs

Commit d220b984 started saving a thumbnail.jpg for each test run.
It's used as the thumbnail for the video. We don't want it listed
as a link alongside stdout.log etc.
stbt camera calibrate: Silence pylint warning

pylint 1.3.1 was complaining:

    [W0632(unbalanced-tuple-unpacking), fit_fn] Possible unbalanced
    tuple unpacking with sequence defined at line 547 of
    scipy.optimize.minpack: left side has 2 label(s), right side has 5
    value(s)

which is clearly not true, according to the scipy documentation:
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.optimize.curve_fit.html
stbt.Region.contains: Allow passing `None` as parameter

This allows the function to take the output from `Region.intersect` or
the `region` attribute of a non-matching `TextMatchResult`.
Refactor: Use builtin `enumerate(...)` rather than `zip(range, ...)`

I added a few instances of enumerating elements in a list for iteration
with:

    for n, x in izip(range(len(l), l):
        ...

This is a much less clear than using the `enumerate` builtin and requires
importing `izip`.  I had used `izip` and `range` because I didn't know
about `enumerate` at the time.
Merge pull request #228 from wmanley/enumerate

Refactor: Use builtin `enumerate(...)` rather than `zip(range, ...)`
make check-nosetests: Ignore user's PYTHONPATH

I had PYTHONPATH pointing at a different, installed, version of stbt and
it caused nose's test-collector to fail.

We already set PYTHONPATH for `make check-pylint`. Since 68983e0 we
neither set nor clear PYTHONPATH for `tests/run-tests.sh` (aka
`make check-integrationtests`) but I'm not sure whether I should leave
that as it is, or set `PYTHONPATH=` -- so I'll leave it as it is.
stbt camera selftests: Avoid spurious error message

Each test is run in its own temporary directory so in most cases this
file doesn't exist (however some tests call `start_fake_video_src` twice
so the `rm` *is* necessary).
stbt camera selftests: Cleanup `run_validation` arguments
stbt camera: Basic documentation
stbt.py: uri_to_remote: Make `display` argument optional

It is only required if instantiating a test remote, whereas we want to
use `uri_to_remote` more broadly in tests so the tests exercise the
production code-paths more often.
Tests: Pull _fake_lircd into seperate function

So we can use it in a subsequent test.  We also:

* Fix a potential race condition by removing a `sleep`
* Make `_fake_lircd` generally more robust to changes in stbt's
  implementation
* Fix a potential race condition with use of `tmpname()`
* Avoid polluting `/tmp` with old no-longer-listening sockets
* Make the `test_that_lirc_remote_is_symmetric_with_lirc_remote_listen`
  test more readable.
* Use multiprocessing rather than thread for improved robustness
stbt.py: stbt.uri_to_remote(lirc): Fix defaulting parameters

Commit 1cd69253 refactored the code for generating remote control objects
into a uri parser (using the `re` module). However, due to the fact that
in regex a glob '*' can match anything including an empty string, there
was a problem in that if the (optional) lirc socket parameter were omitted
"" would be passed to `new_local_lirc_remote` rather than the expected
`None`.

With this commit I change the pattern for optional parameters from `(.*)`
to `(.+)?` to ensure that the group will not match (`None`) rather than
matching the empty string (`""`).

Thanks to Lewis Haley for reporting, diagnosing and creating a candidate
fix in drothlis/#193.
stbt.py: stbt.uri_to_remote: Fix defaulting parameters

In the spirit of the previous commit this commit tightens up the
`uri_to_remote` regexes and ensures the tests are using `uri_to_remote`,
etc. to ensure the codepaths are better trod.

Having done this I came across some bugs in `VirtualRemote` parsing code
which had gone unnoticed.  I wonder if anyone is actually still using
`VirtualRemote`.  Perhaps they should be deprecated and then considered
for removal?