This was a funny bug that has existed for 9 years. It only manifests if
a scraper name starts with the configured basepath... Since the default
basepath is `Comics`, this might manifest if the user wants to fetch
something like `ComicsKingdom/Tiger`. Internally, dosage was removing
the prefix matching the basepath, so we end up with `Kingdom/Tiger`.
This won't cause any problems as long as this substring is still unique
for all supported comics, but if this now matches multiple comics, an
error is thrown...
The default encoding for source files is UTF-8 since Python 3, so we can
drop all encoding headers. While we are at it, just replace them with
SPDX headers.
This shouldn't make a difference in normal dosage usage (since dosage
exits right after this anyways), but it removes hidden dependencies
between tests and might help when embedding dosage into other Python
software. As a side effect this gets rid of some global state, so
running dosage multiple times in the same process is more reliable...
Since we already match comics case-insensitive on the command line, this
was a logical step, even if this means changing quite a bit of code that
all tries to resolve the "comic directory" in a slightly different
way...
This is a first step for #42. Since most access to the scraper classes
is through instances, modules can now dynamically override url and name
(name is now a property).
This is modeled parallel to the "adult" feature, except the user can't
override it via the command line. Each comic module can override the
classmethod getDisabledReasons and give the user a reason why this
module is disabled. The user can see the reason in the comic list (-l or
--singlelist) and the comic module refuses to run, showing the same
message.
This is currently used to disable modules that use the _ParserScraper if
the LXML python module is missing.