mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-03 19:23:32 +02:00
Moved replace_entities to utils.entities.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import struct, re, os
|
||||
|
||||
from ebook_converter import replace_entities
|
||||
from ebook_converter.utils.date import parse_date
|
||||
from ebook_converter.ebooks.mobi import MobiError
|
||||
from ebook_converter.ebooks.metadata import MetaInformation, check_isbn
|
||||
from ebook_converter.ebooks.mobi.langcodes import main_language, sub_language, mobi2iana
|
||||
from ebook_converter.utils.cleantext import clean_ascii_chars, clean_xml_chars
|
||||
from ebook_converter.utils.localization import canonicalize_lang
|
||||
from ebook_converter.utils.config_base import tweaks
|
||||
from ebook_converter.utils import entities
|
||||
from ebook_converter.utils.localization import canonicalize_lang
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
@@ -106,7 +106,8 @@ class EXTHHeader(object): # {{{
|
||||
# else:
|
||||
# print 'unknown record', idx, repr(content)
|
||||
if title:
|
||||
self.mi.title = replace_entities(clean_xml_chars(clean_ascii_chars(title)))
|
||||
title = clean_xml_chars(clean_ascii_chars(title))
|
||||
self.mi.title = entities.replace_entities(title)
|
||||
|
||||
def process_metadata(self, idx, content, codec):
|
||||
if idx == 100:
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
import os
|
||||
|
||||
from ebook_converter import replace_entities
|
||||
from ebook_converter.ebooks.metadata.toc import TOC
|
||||
from ebook_converter.ebooks.mobi.reader.headers import NULL_INDEX
|
||||
from ebook_converter.ebooks.mobi.reader.index import read_index
|
||||
from ebook_converter.utils import entities
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
tag_fieldname_map = {
|
||||
1: ['pos',0],
|
||||
2: ['len',0],
|
||||
@@ -87,7 +83,8 @@ def build_toc(index_entries):
|
||||
for item in level_map[lvl]:
|
||||
parent = num_map[item['parent']]
|
||||
child = parent.add_item(item['href'], item['idtag'],
|
||||
replace_entities(item['text'], encoding=None))
|
||||
entities.replace_entities(item['text'],
|
||||
encoding=None))
|
||||
num_map[item['num']] = child
|
||||
|
||||
# Set play orders in depth first order
|
||||
|
||||
Reference in New Issue
Block a user