Make replwrap.bash() robust against custom prompts in bashrc

By providing our own bashrc which overrides PS1, we can have a
consistent prompt without breaking other customisations of bash that
people may want to keep, such as aliases defined in bashrc.
Modify run() to allow a tuple list of events.

This is a feature enhancement mentioned by #116.
Merge pull request #124 from h2suzuki/run-with-tuple-list-of-events

Modify run() to allow a tuple list of events.
Added ignore_sighup param for pxssh
Merge pull request #129 from zjx20/patch-1

Added ignore_sighup param for pxssh
Rectify docstring typo in compile_pattern_list()
Merge pull request #138 from rickhau/master

Rectify docstring typo in compile_pattern_list()
Remove confusing comment in daemonize() of example/cgishell.cgi
Ignore .git folder during test discovery.

On systems with slow hard disks, py.test can seemingly
hang for a noticeable while -- because it's crawling
the .git/ folder; instruct py.test to ignore it.
Change 'ls -l /bin' test to 'uname -m -n ...'

This test intermittently fails on OSX, an example::

    E           -rwxr-xr-x  1 root  wheel   106816 Sep  9 15:49 pax\r
    E         - -rwsr-xr-x  1 root  wheel    46688 Sep  9 15:59 ps\r
    E         + -rwsr-xr-x  1 root  wheel    46688 Sep  9 15:59 ps\r\r
    E         ?                                                     ++
    E           -rwxr-xr-x  1 root  wheel    14208 Sep  9 15:44 pwd\r
Fix test by prevent bash from sourcing profile

Instead, create a temporary file for use with
--rcfile argument with only the contents
``PS1='GO: '``, ensuring that the tests that
expect some form of '[$#]' succeeds even where
a user's default PS1 prompt does not contain it.
write b'bytes' to rcfile, not 'str/unicode'
remove TODO about ls and change to use uname
Make sure when overriding setUp to call super's
Fix 2nd and 3rd expect/response PS1 prompt
Failure in __str__() before any output.

When calling str() on a spawn class object before
it has any command output, the __str__() override
attempts to truncate long command output while the
value of self.before is still None, raising:

    TypeError: 'NoneType' object has no attribute '__getitem__'
use isinstance of 'str', not 'basestring'
Merge pull request #140 from pexpect/occasionally-failing-testcases

Resolve occasionally failing testcases
Use ternary if/else in spawn.__str__
Merge pull request #115 from takluyver/replwrap-bash-robustness

Make replwrap.bash() robust against custom prompts in bashrc