mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-03-03 23:35:48 +01:00
Convert calibre modules to ebook_converter.
Here is the first batch of modules, which are needed for converting several formats to LRF. Some of the logic has been change, more cleanups will follow.
This commit is contained in:
@@ -7,7 +7,7 @@ __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
from calibre.utils.localization import canonicalize_lang
|
||||
from ebook_converter.utils.localization import canonicalize_lang
|
||||
|
||||
DictionaryLocale = namedtuple('DictionaryLocale', 'langcode countrycode')
|
||||
|
||||
@@ -17,7 +17,7 @@ ccodes, ccodemap, country_names = None, None, None
|
||||
def get_codes():
|
||||
global ccodes, ccodemap, country_names
|
||||
if ccodes is None:
|
||||
from calibre.utils.serialize import msgpack_loads
|
||||
from ebook_converter.utils.serialize import msgpack_loads
|
||||
data = msgpack_loads(P('localization/iso3166.calibre_msgpack', allow_user_override=False, data=True))
|
||||
ccodes, ccodemap, country_names = data['codes'], data['three_map'], data['names']
|
||||
return ccodes, ccodemap
|
||||
|
||||
Reference in New Issue
Block a user