Adhere to coding convention as enforced by tests
Using streaming uploads and download with Swift.

Previous it read entire files and HTTP responses into memory before uploading
or writing them to disk, respectively. Now we read/write in chunks.
Simplify and adjust logging setup

Notably, logging will be set up and sent to stderr regardless of
keyword arguments to configure (that flexibility was never used
anyway) and does not depend if root handlers have already been
registered or not.

Prompted after seeing some of the gratuitous difficulty in debugging
for some people due to lack of output, attempt to streamline and
simplify the logging setup procedure.

There may be a loss here to how well WAL-E composes with other
applications were it used as a library, but there are no such users
known to date nor have they complained, so adjust the trade-off in
favor of a higher chance of getting diagnostics for WAL-E users and
hackers.
Provide nicer logging on non-existant files in the Swift backend.

This now works the same as the S3 backend.
Fixes bug in calling "delete [--confirm] retain" with no base backups.
v0.7a2
Fixes KiB per second calculations that gave incorrectly high values

time.clock() uses processor time, excluding the time spent doing I/O,
but I/O is what we want to measure when timing uploads, etc. Due to
that the KiB/s values were quite a bit higher than the actual transfer
speeds.

Use time.time instead, which measure wall-clock time.
Fix spelling error
Fix vestigial help string from the multi-backend refactor

In the end, the decision was to not attempt to make the credential
situation for each storage backend to appear hold too much in common,
because in practice, they do not: Swift has a litany of tunables, and
AWS has the AWS_SECURITY_TOKEN stuff, and so on.
Minimize the amount of treatment of argv in 'cmd'

Remove some defaults and fallbacks about argv that were not used.
Because of the 'console_scripts' behavior of setuptools, 'cmd.main'
must be able to accept zero arguments and is going to read 'sys.argv'
anyway, which is also the default behavior of 'argparse'.

This breaks a use case of calling 'cmd.py' directly as a toplevel
entry point for the sake of testing, but no known parties do this.
Move pg_xlog test fixture to another file

Done in preparation to have it be shared with other integration
testing, and to communicate that it is a mechanism used by multiple
consumers (soon).
Add some black-box testing

For the first time, perform black box testing by (indirectly) calling
'cmd.main'.

The fixtures implemented here take of things like patching argv and
setting up a bucket to act as a target for the tests.

Besides improving coverage, the idea is that adding analogous
components to the class "AwsTestConfig" and then modifying
"_make_fixture_param_and_ids" will allow for easier, portable smoke
testing of more storage backend functionality.
Fix comments referring to obsolete symbol
Mock out checking for a psql binary in a blackbox test

This test is intended to exercise moving files around to S3 and back
and already goes through pains to nix integration with Postgres, so
finish the job and remove the dependency that 'psql' has to be
installed and able to log in.
Fix dangerous thinkos involving "StandardError"

StandardError is intended to include the built-in exceptions in
Python.

This was pernicious in the 'retries' module, as most errors were of
the form of timeouts, had an errno, and inherited from the built-in
EnvironmentError, yet other failure modes -- like
httplib.IncompleteRead -- would not inherit from StandardError, and
escape the retry.
Call fsync on newly restored files after a tar extract

Without this, a poorly timed whole-system crash (soon after "wal-e
backup-fetch" termination) could cause data corruption since there was
never an explicit request by WAL-E to the kernel to flush pages before
returning from 'backup-fetch'.

Editorialized by Daniel Farina <daniel@heroku.com>
Add htmlcov to .gitignore

This directory is generated by pytest-cov which gathers test coverage,
and it is unlikely anyone would want to commit it.
Don't spin in tight loops with sleep(0), wait 100ms

In principle sleep(0) is all that is necessary to allow another
greenlet to be scheduled, but when encountering defects in WAL-E --
particularly infinite loops -- this could cause unnecessary thrashing
by one's computer.

Sleeping for 100ms doesn't make tests take appreciably longer but does
prevent bugs from mercilessly spinning the CPU.
Add Greg Stark as a contributor
Refactor S3 credential configuration into a support function

This is in anticipation of having to make an alternate branch for IAM
instance profile support, which would otherwise bloat up and make
deeply nested branches in configure_backup_cxt.