1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-05 16:45: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:
2020-04-11 19:33:43 +02:00
parent 69d2e536c5
commit 0f9792df36
252 changed files with 1925 additions and 2344 deletions

View File

@@ -29,16 +29,16 @@ class Unihandecoder(object):
self.preferred_encoding = encoding
lang = lang.lower()
if lang[:2] == 'ja':
from calibre.ebooks.unihandecode.jadecoder import Jadecoder
from ebook_converter.ebooks.unihandecode.jadecoder import Jadecoder
self.decoder = Jadecoder()
elif lang[:2] == 'kr' or lang == 'korean':
from calibre.ebooks.unihandecode.krdecoder import Krdecoder
from ebook_converter.ebooks.unihandecode.krdecoder import Krdecoder
self.decoder = Krdecoder()
elif lang[:2] == 'vn' or lang == 'vietnum':
from calibre.ebooks.unihandecode.vndecoder import Vndecoder
from ebook_converter.ebooks.unihandecode.vndecoder import Vndecoder
self.decoder = Vndecoder()
else: # zh and others
from calibre.ebooks.unihandecode.unidecoder import Unidecoder
from ebook_converter.ebooks.unihandecode.unidecoder import Unidecoder
self.decoder = Unidecoder()
def decode(self, text):

View File

@@ -20,10 +20,10 @@ Copyright (c) 2010 Hiroshi Miura
'''
import re
from calibre.ebooks.unihandecode.unidecoder import Unidecoder
from calibre.ebooks.unihandecode.unicodepoints import CODEPOINTS
from calibre.ebooks.unihandecode.jacodepoints import CODEPOINTS as JACODES
from calibre.ebooks.unihandecode.pykakasi.kakasi import kakasi
from ebook_converter.ebooks.unihandecode.unidecoder import Unidecoder
from ebook_converter.ebooks.unihandecode.unicodepoints import CODEPOINTS
from ebook_converter.ebooks.unihandecode.jacodepoints import CODEPOINTS as JACODES
from ebook_converter.ebooks.unihandecode.pykakasi.kakasi import kakasi
class Jadecoder(Unidecoder):

View File

@@ -11,9 +11,9 @@ Based on unidecoder.
'''
from calibre.ebooks.unihandecode.unidecoder import Unidecoder
from calibre.ebooks.unihandecode.krcodepoints import CODEPOINTS as HANCODES
from calibre.ebooks.unihandecode.unicodepoints import CODEPOINTS
from ebook_converter.ebooks.unihandecode.unidecoder import Unidecoder
from ebook_converter.ebooks.unihandecode.krcodepoints import CODEPOINTS as HANCODES
from ebook_converter.ebooks.unihandecode.unicodepoints import CODEPOINTS
class Krdecoder(Unidecoder):

View File

@@ -61,9 +61,9 @@ it under the same terms as Perl itself.
'''
import re
from calibre.ebooks.unihandecode.unicodepoints import CODEPOINTS
from calibre.ebooks.unihandecode.zhcodepoints import CODEPOINTS as HANCODES
from polyglot.builtins import unicode_type
from ebook_converter.ebooks.unihandecode.unicodepoints import CODEPOINTS
from ebook_converter.ebooks.unihandecode.zhcodepoints import CODEPOINTS as HANCODES
from ebook_converter.polyglot.builtins import unicode_type
class Unidecoder(object):

View File

@@ -10,9 +10,9 @@ Decode unicode text to an ASCII representation of the text in Vietnamese.
'''
from calibre.ebooks.unihandecode.unidecoder import Unidecoder
from calibre.ebooks.unihandecode.vncodepoints import CODEPOINTS as HANCODES
from calibre.ebooks.unihandecode.unicodepoints import CODEPOINTS
from ebook_converter.ebooks.unihandecode.unidecoder import Unidecoder
from ebook_converter.ebooks.unihandecode.vncodepoints import CODEPOINTS as HANCODES
from ebook_converter.ebooks.unihandecode.unicodepoints import CODEPOINTS
class Vndecoder(Unidecoder):