Merge pull request #1 from grahams/master

a new helper for soundcloud tracks.
tests: use assertIsInstance instead of open-coding it

unittests offers an assertIsInstance so we don't need to do the
type(x) == y pattern.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
database: add ability to describe tables and confirm requires columns

We want to be able to check whether the database schema looks right when
we connect rather than find out after a failed query.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
result: fix nsfw->flags rename, fix flag merging, and add tests for flag reporting/merging

The rename from nsfw->flags in linkcache.py didn't get mirrored in
result.py, so flags were getting ignored.

The ~NSFW->NSFW transition was incorrectly implemented. I've added tests
to ensure correctness there.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
linkcache: catch AssertionError separately

The except Exception catch-all is wrong and needs to be finer grained. This
will happen gradually, but we can start by catching AssertionError.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
Merge pull request #3 from jeffmahoney/to-push

To push
linkcache: getparam('charset') can return None

Default to 'utf-8' if charset is None

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
tests: add missing mock passwords.txt

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
linkcache: catch URLError and ignore if interpolated

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
database: fix table confirmation

We were checking 'int' vs 'integer' and failing.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
linkcache: handle browser's idea of encoding

mechanize.Browser can have a different idea of what encoding is in
use from that in the html file. This can result in UnicodeDecodeErrors
popping up. Use the unicode version immediately, encoding with
the browser's encoding.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
database.sql: just be happy with 'int' as a substring in the id

sqlite uses 'integer' and mysql uses 'int(32)'

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
Merge branch 'master' of github.com:grahams/linkcache