Every mime related function in main __init__.py has a flag check for the
check if initialization has already done. This is nonsense, since it
should be done implicitly early on the converter is starting.
This commit straight the things out, and initialization is done in cli
module.
Also, function guess_type was removed, since it's just a proxy for
mimetypes.guess_type function.
This is progressing refactor of the calibre code to make it more
readable, and transform it to something more coherent.
In this patch, there are changes regarding imports for some modules,
instead of polluting namespace of each module with some other modules
symbols, which often were imported from other modules. Yuck.
In Calibre there is a module, which registers two functions in global
scope, one for filepath and one for images path. It relies on additional
three variables, registered during application startup. I found it
overcomplicated, and couple of the resource paths has been calculated
using pkg_resource module.
During tests, there was issue regarding ODF2XHTML.xhtml() method, which
assumes, that all lines are stored as strings. Although, in case of
single items, like footnotes, there is a chance, that numbers are stored
as ints. In this patch we assure, that all lines has to be strings. This
bug also affects current version of Calibre (as of cf5baaf449 commit).