mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-01-06 19:44:12 +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:
@@ -15,7 +15,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
# $Date: 2006/03/24 23:50:07 $
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import headings_to_sections, \
|
||||
from ebook_converter.ebooks.rtf2xml import headings_to_sections, \
|
||||
line_endings, footnote, fields_small, default_encoding, \
|
||||
make_lists, preamble_div, header, colors, group_borders, \
|
||||
check_encoding, add_brackets, table, combine_borders, \
|
||||
@@ -25,8 +25,8 @@ from calibre.ebooks.rtf2xml import headings_to_sections, \
|
||||
list_numbers, info, pict, table_info, fonts, paragraphs, \
|
||||
body_styles, preamble_rest, group_styles, \
|
||||
inline
|
||||
from calibre.ebooks.rtf2xml.old_rtf import OldRtf
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml.old_rtf import OldRtf
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy, check_brackets
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import iteritems
|
||||
from ebook_converter.ebooks.rtf2xml import copy, check_brackets
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import iteritems
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import os
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
"""
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
|
||||
import sys
|
||||
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
|
||||
class CheckEncoding:
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os, re
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from __future__ import unicode_literals, absolute_import, print_function, division
|
||||
import os, sys
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy, check_encoding
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy, check_encoding
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
public_dtd = 'rtf2xml1.0.dtd'
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os
|
||||
from calibre.ebooks.rtf2xml import field_strings, copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import field_strings, copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os, re
|
||||
|
||||
from calibre.ebooks.rtf2xml import field_strings, copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import field_strings, copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os, re
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os, re
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import os, re
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import sys, os, io
|
||||
|
||||
from calibre.ebooks.rtf2xml import get_char_map, copy
|
||||
from calibre.ebooks.rtf2xml.char_set import char_set
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import get_char_map, copy
|
||||
from ebook_converter.ebooks.rtf2xml.char_set import char_set
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os, re
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from __future__ import unicode_literals, absolute_import, print_function, division
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
"""
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.utils.cleantext import clean_ascii_chars
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.utils.cleantext import clean_ascii_chars
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
|
||||
|
||||
class FixLineEndings:
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import os
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
# #
|
||||
#########################################################################
|
||||
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
|
||||
class ListTable:
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os, re
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import sys
|
||||
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os
|
||||
from polyglot.builtins import raw_input
|
||||
from ebook_converter.polyglot.builtins import raw_input
|
||||
from . import open_for_read, open_for_write
|
||||
# , codecs
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy, border_parse
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy, border_parse
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ from __future__ import print_function
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os
|
||||
from calibre.ebooks.rtf2xml import copy, override_table, list_table
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy, override_table, list_table
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import sys,os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import os, re
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy, check_brackets
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy, check_brackets
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os
|
||||
from calibre.ebooks.rtf2xml import copy, border_parse
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy, border_parse
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
#########################################################################
|
||||
import sys, os
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy, border_parse
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import unicode_type
|
||||
from ebook_converter.ebooks.rtf2xml import copy, border_parse
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import unicode_type
|
||||
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
# #
|
||||
#########################################################################
|
||||
import os
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
# note to self. This is the first module in which I use tempfile. A good idea?
|
||||
|
||||
@@ -13,10 +13,10 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
|
||||
#########################################################################
|
||||
import os, re
|
||||
|
||||
from calibre.ebooks.rtf2xml import copy
|
||||
from calibre.utils.mreplace import MReplace
|
||||
from calibre.ptempfile import better_mktemp
|
||||
from polyglot.builtins import codepoint_to_chr, range, filter, map
|
||||
from ebook_converter.ebooks.rtf2xml import copy
|
||||
from ebook_converter.utils.mreplace import MReplace
|
||||
from ebook_converter.ptempfile import better_mktemp
|
||||
from ebook_converter.polyglot.builtins import codepoint_to_chr, range, filter, map
|
||||
from . import open_for_read, open_for_write
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user