id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27,200 | simple_worker.py | kovidgoyal_calibre/src/calibre/utils/ipc/simple_worker.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import importlib
import os
import time
import traceback
from multiprocessing import Pipe
from threading import Thread
from calibre.constants import iswindows
from calibre.u... | 11,775 | Python | .py | 281 | 32.619217 | 109 | 0.61116 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,201 | worker.py | kovidgoyal_calibre/src/calibre/utils/ipc/worker.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import importlib
import os
import sys
from threading import Thread
from zipimport import ZipImportError
from calibre import prints
from calibre.constants import ismacos, is... | 7,651 | Python | .py | 192 | 32.895833 | 139 | 0.658172 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,202 | __init__.py | kovidgoyal_calibre/src/calibre/utils/ipc/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import os
from calibre import force_unicode
from calibre.constants import filesystem_encoding, get_windows_username, islinux, iswindows
from calibre.utils.file... | 1,648 | Python | .py | 45 | 29.377778 | 118 | 0.622642 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,203 | launch.py | kovidgoyal_calibre/src/calibre/utils/ipc/launch.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import subprocess
import sys
import time
from calibre.constants import isfrozen, ismacos, iswindows
from calibre.ptempfile import PersistentTemporaryFile, base_dir... | 7,685 | Python | .py | 191 | 30.314136 | 151 | 0.595602 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,204 | job.py | kovidgoyal_calibre/src/calibre/utils/ipc/job.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import io
import time
from itertools import count
from calibre import prints
from calibre.constants import DEBUG
from calibre.utils.localization import _
from polyglot.bui... | 5,074 | Python | .py | 143 | 25.685315 | 80 | 0.557076 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,205 | server.py | kovidgoyal_calibre/src/calibre/utils/ipc/server.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import sys
import tempfile
import time
from collections import deque
from itertools import count
from math import ceil
from multiprocessing import Pipe
from threa... | 9,579 | Python | .py | 261 | 25.08046 | 109 | 0.545484 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,206 | description.py | kovidgoyal_calibre/src/calibre/utils/opensearch/description.py | __license__ = 'GPL 3'
__copyright__ = '''
2011, John Schember <john@nachtimwald.com>,
2006, Ed Summers <ehs@pobox.com>
'''
__docformat__ = 'restructuredtext en'
from contextlib import closing
from calibre import browser
from calibre.utils.opensearch.url import URL
from calibre.utils.xml_parse import safe_xml_fromstri... | 4,454 | Python | .py | 102 | 34.156863 | 108 | 0.564635 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,207 | url.py | kovidgoyal_calibre/src/calibre/utils/opensearch/url.py | __license__ = 'GPL 3'
__copyright__ = '2006, Ed Summers <ehs@pobox.com>'
__docformat__ = 'restructuredtext en'
class URL:
'''
Class for representing a URL in an opensearch v1.1 query
'''
def __init__(self, type='', template='', method='GET'):
self.type = type
self.template = template
... | 373 | Python | .py | 12 | 25.833333 | 60 | 0.592179 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,208 | __init__.py | kovidgoyal_calibre/src/calibre/utils/opensearch/__init__.py | '''
Based on the OpenSearch Python module by Ed Summers <ehs@pobox.com> from
https://github.com/edsu/opensearch .
This module is heavily modified and does not implement all the features from
the original. The ability for the module to perform a search and retrieve
search results has been removed. The original module u... | 1,330 | Python | .py | 28 | 46.035714 | 77 | 0.808198 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,209 | query.py | kovidgoyal_calibre/src/calibre/utils/opensearch/query.py | __license__ = 'GPL 3'
__copyright__ = '2006, Ed Summers <ehs@pobox.com>'
__docformat__ = 'restructuredtext en'
from polyglot.urllib import parse_qs, urlencode, urlparse, urlunparse
class Query:
'''
Represents an opensearch query Really this class is just a
helper for substituting values into the macros i... | 2,429 | Python | .py | 55 | 35.490909 | 97 | 0.629237 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,210 | __init__.py | kovidgoyal_calibre/src/calibre/utils/rcc/__init__.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
import io
import os
import sys
import tempfile
from posixpath import normpath
from qt.core import QFile, QIODevice
from calibre_extensions import rcc_backend
def compile_qrc(output_path, *qrc_file_paths):
rcc = rcc_b... | 4,868 | Python | .py | 114 | 32.570175 | 123 | 0.563859 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,211 | emf.py | kovidgoyal_calibre/src/calibre/utils/wmf/emf.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import sys
from collections import namedtuple
from struct import unpack_from
from calibre.utils.wmf import create_bmp_from_dib, to_png
from polyglot.builtins import iteritems
# Record types {{{
# See: http://... | 3,004 | Python | .py | 76 | 33.802632 | 145 | 0.641801 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,212 | __init__.py | kovidgoyal_calibre/src/calibre/utils/wmf/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import struct
class Unavailable(Exception):
pass
class NoRaster(Exception):
pass
class DIBHeader:
'''
See http://en.wikipedia.org/wiki/BMP_file_format... | 2,116 | Python | .py | 55 | 29.909091 | 78 | 0.575061 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,213 | parse.py | kovidgoyal_calibre/src/calibre/utils/wmf/parse.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import struct
import sys
from calibre.utils.wmf import create_bmp_from_dib, to_png
class WMFHeader:
'''
For header documentation, see
http://www.skynet.ie/~c... | 7,460 | Python | .py | 197 | 25.639594 | 86 | 0.509888 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,214 | __init__.py | kovidgoyal_calibre/src/calibre/utils/podofo/__init__.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2009, Kovid Goyal <kovid at kovidgoyal.net>
import os
import shutil
import sys
from calibre.constants import preferred_encoding
from calibre.ebooks.metadata import authors_to_string
from calibre.ptempfile import TemporaryDirectory
from calibre.utils.ipc.simple_worker... | 10,108 | Python | .py | 218 | 39.706422 | 2,663 | 0.647214 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,215 | linux.py | kovidgoyal_calibre/src/calibre/utils/open_with/linux.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import re
import shlex
from collections import defaultdict
from calibre import force_unicode, guess_type, prints, walk
from calibre.constants import cache_dir, filesystem_encoding
from calibre.utils.... | 8,579 | Python | .py | 225 | 28.066667 | 103 | 0.54057 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,216 | windows.py | kovidgoyal_calibre/src/calibre/utils/open_with/windows.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import re
import sys
from qt.core import QBuffer, QByteArray, QIODevice, QPixmap, Qt
from calibre.gui2 import must_use_qt
from calibre.utils.winreg.default_programs import split_commandline
from cal... | 4,089 | Python | .py | 105 | 32.028571 | 147 | 0.651833 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,217 | osx.py | kovidgoyal_calibre/src/calibre/utils/open_with/osx.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import mimetypes
import os
import re
import subprocess
from collections import defaultdict
from plistlib import loads
from calibre.ptempfile import TemporaryDirectory
from calibre.utils.icu import numeric_sort... | 13,678 | Python | .py | 329 | 34.392097 | 154 | 0.539368 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,218 | hyphenate.py | kovidgoyal_calibre/src/calibre/utils/hyphenation/hyphenate.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import os
import regex
from calibre.utils.hyphenation.dictionaries import dictionary_name_for_locale, path_to_dictionary
from polyglot.functools import lru_cache
REGEX_FLAGS = regex.VERSION1 | regex.WORD | regex.FULLCASE... | 3,599 | Python | .py | 92 | 32.652174 | 97 | 0.632032 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,219 | test_hyphenation.py | kovidgoyal_calibre/src/calibre/utils/hyphenation/test_hyphenation.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import os
import shutil
import unittest
from lxml import etree
from calibre.ebooks.oeb.polish.parsing import parse_html5
from calibre.ptempfile import PersistentTemporaryDirectory
from calibre.utils.hyphenation.dictionari... | 3,185 | Python | .py | 75 | 34.226667 | 140 | 0.636216 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,220 | dictionaries.py | kovidgoyal_calibre/src/calibre/utils/hyphenation/dictionaries.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import errno
import json
import os
import tarfile
from io import BytesIO
from calibre.constants import cache_dir
from calibre.ptempfile import TemporaryDirectory
from calibre.utils.localization import lang_as_iso639_1
from... | 3,718 | Python | .py | 108 | 26.898148 | 121 | 0.613693 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,221 | win_fonts.py | kovidgoyal_calibre/src/calibre/utils/fonts/win_fonts.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import atexit
import os
import sys
from itertools import product
from calibre import isbytestring, prints
from calibre.constants import filesystem_encoding
from calibre.... | 6,065 | Python | .py | 147 | 29.47619 | 96 | 0.537978 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,222 | utils.py | kovidgoyal_calibre/src/calibre/utils/fonts/utils.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import struct
from collections import defaultdict
from io import BytesIO
from calibre.utils.resources import get_path as P
from polyglot.builtins import as_bytes, iterit... | 19,589 | Python | .py | 455 | 34.964835 | 154 | 0.628053 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,223 | metadata.py | kovidgoyal_calibre/src/calibre/utils/fonts/metadata.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from collections import namedtuple
from io import BytesIO
from calibre.utils.fonts.utils import get_font_characteristics, get_font_names_from_ttlib_names_table
class U... | 3,243 | Python | .py | 80 | 31.3 | 131 | 0.608779 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,224 | __init__.py | kovidgoyal_calibre/src/calibre/utils/fonts/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
| 146 | Python | .py | 4 | 35 | 58 | 0.678571 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,225 | free_type.py | kovidgoyal_calibre/src/calibre/utils/fonts/free_type.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import threading
from functools import wraps
from calibre_extensions.freetype import FreeType as _FreeType
class ThreadingViolation(Exception):
def __init__(self)... | 2,132 | Python | .py | 55 | 30.6 | 82 | 0.624575 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,226 | scanner.py | kovidgoyal_calibre/src/calibre/utils/fonts/scanner.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from collections import defaultdict
from threading import Thread
from calibre import as_unicode, prints, walk
from calibre.constants import DEBUG, config_dir, ... | 13,881 | Python | .py | 356 | 28.542135 | 123 | 0.572596 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,227 | subset.py | kovidgoyal_calibre/src/calibre/utils/fonts/subset.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2023, Kovid Goyal <kovid at kovidgoyal.net>
import os
import sys
from logging.handlers import QueueHandler
from queue import Empty, SimpleQueue
def subset(input_file_object_or_path, output_file_object_or_path, container_type, chars_or_text=''):
from fontTools.sub... | 1,635 | Python | .py | 41 | 33.487805 | 100 | 0.657646 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,228 | errors.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/errors.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
class UnsupportedFont(ValueError):
pass
class NoGlyphs(ValueError):
pass
| 235 | Python | .py | 8 | 26.5 | 61 | 0.718182 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,229 | merge.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/merge.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
from collections import OrderedDict
from functools import partial
class GlyphSizeMismatch(ValueError):
pass
def merge_truetype_fonts_for_pdf(fonts, log=None):
all_glyphs = {}
ans = fonts[0]
hmetrics_map ... | 3,256 | Python | .py | 76 | 31.381579 | 133 | 0.54686 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,230 | container.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/container.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2012, Kovid Goyal <kovid at kovidgoyal.net>
from collections import OrderedDict
from io import BytesIO
from struct import calcsize, pack
from calibre.utils.fonts.sfnt import UnknownTable, align_block, max_power_of_two
from calibre.utils.fonts.sfnt.cff.table import CF... | 6,328 | Python | .py | 146 | 33.89726 | 106 | 0.58791 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,231 | loca.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/loca.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import array
import sys
from itertools import repeat
from operator import itemgetter
from calibre.utils.fonts.sfnt import UnknownTable
from polyglot.builtins import iter... | 3,222 | Python | .py | 75 | 34.546667 | 83 | 0.608432 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,232 | maxp.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/maxp.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from struct import pack, unpack_from
from calibre.utils.fonts.sfnt import FixedProperty, UnknownTable
from calibre.utils.fonts.sfnt.errors import UnsupportedFont
class... | 1,569 | Python | .py | 32 | 38.53125 | 79 | 0.58623 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,233 | metrics.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/metrics.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.utils.fonts.sfnt.container import UnsupportedFont
from calibre.utils.fonts.utils import get_all_font_names
class FontMetrics:
'''
Get various metr... | 5,050 | Python | .py | 106 | 38.971698 | 84 | 0.626371 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,234 | __init__.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from datetime import datetime, timedelta
def align_block(raw, multiple=4, pad=b'\0'):
'''
Return raw with enough pad bytes append to ensure its length is a mult... | 1,642 | Python | .py | 54 | 24.574074 | 78 | 0.603327 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,235 | kern.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/kern.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from struct import calcsize, pack, unpack_from
from struct import error as struct_error
from calibre.utils.fonts.sfnt import FixedProperty, UnknownTable, max_power_of_tw... | 3,304 | Python | .py | 72 | 35.236111 | 86 | 0.575381 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,236 | cmap.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/cmap.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
# Note that the code for creating a BMP table (cmap format 4) is taken with
# thanks from the fonttools project (BSD licensed).
from collections import OrderedDict
from ... | 10,641 | Python | .py | 249 | 31.686747 | 99 | 0.551464 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,237 | glyf.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/glyf.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from collections import OrderedDict
from struct import unpack_from
from calibre.utils.fonts.sfnt import UnknownTable
from polyglot.builtins import iteritems
ARG_1_AND_2... | 3,376 | Python | .py | 76 | 36.552632 | 115 | 0.610908 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,238 | head.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/head.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import array
from struct import calcsize, pack, unpack_from
from calibre.utils.fonts.sfnt import DateTimeProperty, FixedProperty, UnknownTable
from calibre.utils.fonts.s... | 8,301 | Python | .py | 209 | 30.205742 | 123 | 0.538137 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,239 | subset.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/subset.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import traceback
from collections import OrderedDict
from functools import partial
from operator import itemgetter
from calibre.utils.fonts.sfnt.container import Sfnt
fr... | 12,567 | Python | .py | 321 | 30.800623 | 93 | 0.59325 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,240 | common.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/common.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from collections import OrderedDict, namedtuple
from struct import calcsize, unpack_from
from calibre.utils.fonts.sfnt.errors import UnsupportedFont
from polyglot.builti... | 7,712 | Python | .py | 179 | 33.837989 | 92 | 0.615869 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,241 | gsub.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/gsub.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from functools import partial
from struct import unpack_from
from calibre.utils.fonts.sfnt import FixedProperty, UnknownTable
from calibre.utils.fonts.sfnt.common import... | 5,849 | Python | .py | 133 | 35.466165 | 153 | 0.66543 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,242 | constants.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/cff/constants.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
# cff_standard_strings {{{
# The 391 Standard Strings as used in the CFF format.
# from Adobe Technical None #5176, version 1.0, 18 March 1998
cff_standard_strings = [
... | 11,432 | Python | .py | 171 | 63.222222 | 79 | 0.652653 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,243 | writer.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/cff/writer.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from collections import OrderedDict
from struct import pack
from calibre.utils.fonts.sfnt.cff.constants import cff_standard_strings
class Index(list):
def __init_... | 5,296 | Python | .py | 145 | 26.834483 | 77 | 0.557862 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,244 | __init__.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/cff/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
| 152 | Python | .py | 4 | 35.75 | 61 | 0.678322 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,245 | table.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/cff/table.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from functools import partial
from struct import calcsize, unpack, unpack_from
from calibre.utils.fonts.sfnt import UnknownTable
from calibre.utils.fonts.sfnt.cff.consta... | 7,736 | Python | .py | 174 | 34.212644 | 90 | 0.596115 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,246 | dict_data.py | kovidgoyal_calibre/src/calibre/utils/fonts/sfnt/cff/dict_data.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from struct import pack, unpack_from
t1_operand_encoding = [None] * 256
t1_operand_encoding[0:32] = (32) * ... | 11,436 | Python | .py | 263 | 34.745247 | 79 | 0.490023 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,247 | wintest.py | kovidgoyal_calibre/src/calibre/utils/windows/wintest.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import os
import unittest
class TestWinutil(unittest.TestCase):
def setUp(self):
from calibre_extensions import winutil
self.winutil = winutil
def tearDown(self):
del self.winutil
de... | 1,140 | Python | .py | 26 | 37.307692 | 111 | 0.69873 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,248 | __init__.py | kovidgoyal_calibre/src/calibre/utils/spell/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
| 112 | Python | .py | 3 | 34.666667 | 61 | 0.673077 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,249 | hyphenate.py | kovidgoyal_calibre/src/calibre/ebooks/hyphenate.py | """ Hyphenation, using Frank Liang's algorithm.
This module provides a single function to hyphenate words. hyphenate_word takes
a string (the word), and returns a list of parts that can be separated by hyphens.
>>> hyphenate_word("hyphenation")
['hy', 'phen', 'ation']
>>> hyphenate_word("supercal... | 35,535 | Python | .py | 507 | 67.583826 | 104 | 0.809763 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,250 | html_entities.py | kovidgoyal_calibre/src/calibre/ebooks/html_entities.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
from calibre import my_unichr
html5_entities = {
# ENTITY_DATA {{{
'AElig': 'Æ',
'AMP': '&',
'Aacute': '�',
'Abreve': 'Ä‚',
'Acirc': 'Â',
'Acy': '�',
'Afr': '�',
'Agrave': 'À',
'Al... | 49,754 | Python | .py | 2,228 | 17.174147 | 154 | 0.406697 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,251 | BeautifulSoup.py | kovidgoyal_calibre/src/calibre/ebooks/BeautifulSoup.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import bs4
from bs4 import CData, Comment, Declaration, NavigableString, ProcessingInstruction, SoupStrainer, Tag, __version__ # noqa
def parse_html(markup):
from calibre import xml_replace_entities
from calibre.e... | 1,086 | Python | .py | 25 | 38.68 | 123 | 0.729781 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,252 | tweak.py | kovidgoyal_calibre/src/calibre/ebooks/tweak.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import sys
import unicodedata
from calibre import as_unicode, prints, walk
from calibre.constants import __appname__, iswindows
from calibre.libunzip import extra... | 6,683 | Python | .py | 168 | 31.875 | 117 | 0.625174 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,253 | css_transform_rules.py | kovidgoyal_calibre/src/calibre/ebooks/css_transform_rules.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import numbers
import operator
from collections import OrderedDict
from functools import partial
from css_parser.css import CSSRule, Property
from calibre import force_unicode
from calibre.ebooks import parse_css_length
fr... | 17,064 | Python | .py | 401 | 33.254364 | 159 | 0.574106 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,254 | constants.py | kovidgoyal_calibre/src/calibre/ebooks/constants.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
html5_tags = ( # {{{
frozenset('''\
html
head
title
base
link
meta
style
script
noscript
body
section
nav
article
aside
h1
h2
h3
h4
h5
h6
header
footer
address
p
hr
br
pre
dialog
blockquote
ol
ul
li
dl
dt
dd
a... | 703 | Python | .py | 106 | 5.603774 | 61 | 0.888889 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,255 | covers.py | kovidgoyal_calibre/src/calibre/ebooks/covers.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import numbers
import random
import re
import unicodedata
from collections import namedtuple
from contextlib import contextmanager
from itertools import chain
from math import atan2, ceil, cos, sin, sqrt
from ... | 31,664 | Python | .py | 646 | 41.400929 | 3,861 | 0.642198 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,256 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/__init__.py | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
Code for the conversion of ebook formats and the reading of metadata
from various formats.
'''
import numbers
import os
import re
import sys
from contextlib import suppress
from calibre import prints
from calibre.ebooks.charde... | 8,160 | Python | .py | 206 | 31.160194 | 122 | 0.576053 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,257 | html_transform_rules.py | kovidgoyal_calibre/src/calibre/ebooks/html_transform_rules.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import re
from functools import partial
from html5_parser import parse
from lxml import etree
from calibre.ebooks.metadata.tag_mapper import uniq
from calibre.ebooks.oeb.base import OEB_DOCS, XPath
from calibre.ebooks.oeb.... | 23,104 | Python | .py | 549 | 33.132969 | 154 | 0.558438 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,258 | chardet.py | kovidgoyal_calibre/src/calibre/ebooks/chardet.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import codecs
import re
import sys
from calibre import xml_replace_entities
_encoding_pats = (
# XML declaration
r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',... | 6,107 | Python | .py | 160 | 30.71875 | 130 | 0.603483 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,259 | render_html.py | kovidgoyal_calibre/src/calibre/ebooks/render_html.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import os
import sys
from qt.core import QApplication, QByteArray, QMarginsF, QPageLayout, QPageSize, Qt, QTimer, QUrl
from qt.webengine import (
QWebEnginePage,
QWebEngineProfile,
QWebEngineScript,
QWebEng... | 7,437 | Python | .py | 165 | 35.818182 | 139 | 0.640293 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,260 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/iterator/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
| 146 | Python | .py | 4 | 35 | 58 | 0.678571 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,261 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/epub/__init__.py | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
Conversion to EPUB.
'''
from calibre.utils.zipfile import ZIP_STORED, ZipFile
def rules(stylesheets):
for s in stylesheets:
if hasattr(s, 'cssText'):
for r in s:
... | 1,472 | Python | .py | 40 | 31.275 | 81 | 0.647719 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,262 | periodical.py | kovidgoyal_calibre/src/calibre/ebooks/epub/periodical.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import time
from uuid import uuid4
from calibre import prepare_string_for_xml as xml
from calibre import strftime
from calibre.constants import __appname__, __version__
fro... | 6,117 | Python | .py | 167 | 29.065868 | 107 | 0.595849 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,263 | pages.py | kovidgoyal_calibre/src/calibre/ebooks/epub/pages.py | '''
Add page mapping information to an EPUB book.
'''
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
from itertools import count
from lxml.etree import XPath
from calibre.ebooks.oeb.base import XHTML_NS, OEBBook
NSMAP = {... | 1,673 | Python | .py | 49 | 27.897959 | 66 | 0.61825 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,264 | tests.py | kovidgoyal_calibre/src/calibre/ebooks/epub/cfi/tests.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import numbers
import unittest
from calibre.ebooks.epub.cfi.parse import cfi_sort_key, decode_cfi, parser
from polyglot.builtins import iteritems
class Tests(unittest.TestCase):
def test_sorting(self):
... | 4,540 | Python | .py | 116 | 28.396552 | 103 | 0.413738 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,265 | parse.py | kovidgoyal_calibre/src/calibre/ebooks/epub/cfi/parse.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import regex
class Parser:
''' See epubcfi.ebnf for the specification that this parser tries to
follow. I have implemented it manually, since I dont want to depend on
grako, and the grammar is pr... | 8,253 | Python | .py | 212 | 29.65566 | 129 | 0.544024 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,266 | headings_to_sections.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/headings_to_sections.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 8,271 | Python | .py | 213 | 29.117371 | 88 | 0.497264 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,267 | default_encoding.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/default_encoding.py | #########################################################################
# #
# copyright 2002 Paul Henry Tremblay #
# #
########################... | 6,373 | Python | .py | 175 | 24.417143 | 93 | 0.465643 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,268 | colors.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/colors.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 9,537 | Python | .py | 245 | 27.726531 | 86 | 0.481729 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,269 | inline.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/inline.py | import os
import sys
from calibre.ebooks.rtf2xml import copy
from calibre.ptempfile import better_mktemp
from . import open_for_read, open_for_write
"""
States.
1. default
1. an open bracket ends this state.
2. Text print out text. Print out any groups_in_waiting.
3. closed bracket. Close groups
2. after... | 16,619 | Python | .py | 409 | 28.202934 | 101 | 0.48317 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,270 | group_borders.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/group_borders.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 10,920 | Python | .py | 291 | 27.474227 | 103 | 0.497031 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,271 | add_brackets.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/add_brackets.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 8,941 | Python | .py | 218 | 30.183486 | 83 | 0.486794 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,272 | convert_to_tags.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/convert_to_tags.py | import os
import sys
from calibre.ebooks.rtf2xml import check_encoding, copy
from calibre.ptempfile import better_mktemp
from . import open_for_read, open_for_write
public_dtd = 'rtf2xml1.0.dtd'
class ConvertToTags:
"""
Convert file to XML
"""
def __init__(self,
in_file,
bu... | 10,505 | Python | .py | 266 | 28.631579 | 96 | 0.522994 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,273 | group_styles.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/group_styles.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 8,813 | Python | .py | 240 | 27.041667 | 88 | 0.487848 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,274 | get_char_map.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/get_char_map.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 2,080 | Python | .py | 49 | 33.44898 | 73 | 0.373947 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,275 | border_parse.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/border_parse.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 8,117 | Python | .py | 185 | 33.745946 | 81 | 0.493882 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,276 | get_options.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/get_options.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 14,734 | Python | .py | 328 | 31.939024 | 100 | 0.471458 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,277 | preamble_rest.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/preamble_rest.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 5,699 | Python | .py | 143 | 30.216783 | 95 | 0.491788 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,278 | check_encoding.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/check_encoding.py | #!/usr/bin/env python
import sys
class CheckEncoding:
def __init__(self, bug_handler):
self.__bug_handler = bug_handler
def __get_position_error(self, line, encoding, line_num):
char_position = 0
for char in line:
char_position +=1
try:
char.... | 1,220 | Python | .py | 31 | 26.451613 | 98 | 0.514407 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,279 | field_strings.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/field_strings.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 34,870 | Python | .py | 790 | 33.683544 | 134 | 0.515182 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,280 | body_styles.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/body_styles.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 3,343 | Python | .py | 78 | 33.410256 | 79 | 0.451504 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,281 | list_numbers.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/list_numbers.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 7,743 | Python | .py | 190 | 30.847368 | 78 | 0.501392 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,282 | replace_illegals.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/replace_illegals.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 1,900 | Python | .py | 42 | 38.952381 | 73 | 0.430886 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,283 | delete_info.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/delete_info.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 8,347 | Python | .py | 201 | 28.686567 | 99 | 0.453774 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,284 | header.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/header.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 10,613 | Python | .py | 243 | 32.720165 | 86 | 0.515989 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,285 | check_brackets.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/check_brackets.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 2,429 | Python | .py | 52 | 37.923077 | 92 | 0.424831 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,286 | output.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/output.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 4,114 | Python | .py | 113 | 26.79646 | 87 | 0.455411 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,287 | process_tokens.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/process_tokens.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 41,971 | Python | .py | 803 | 41.41345 | 102 | 0.448475 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,288 | configure_txt.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/configure_txt.py | import os
import sys
from . import open_for_read
class Configure:
def __init__(self,
configuration_file,
bug_handler,
debug_dir=None,
show_config_file=None,
):
"""
Requires:
file --fil... | 6,190 | Python | .py | 153 | 27.071895 | 92 | 0.505473 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,289 | copy.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/copy.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 2,542 | Python | .py | 55 | 38.454545 | 81 | 0.459863 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,290 | __init__.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/__init__.py | def open_for_read(path):
return open(path, encoding='utf-8', errors='replace')
def open_for_write(path, append=False):
mode = 'a' if append else 'w'
return open(path, mode, encoding='utf-8', errors='replace', newline='')
| 235 | Python | .py | 5 | 43.2 | 75 | 0.679825 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,291 | fonts.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/fonts.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 8,962 | Python | .py | 215 | 30.972093 | 104 | 0.506812 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,292 | combine_borders.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/combine_borders.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 3,458 | Python | .py | 82 | 32.939024 | 73 | 0.44844 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,293 | table_info.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/table_info.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 3,515 | Python | .py | 82 | 32.95122 | 78 | 0.446293 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,294 | table.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/table.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 20,940 | Python | .py | 541 | 28.530499 | 94 | 0.512148 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,295 | paragraphs.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/paragraphs.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 10,342 | Python | .py | 249 | 31.975904 | 91 | 0.520441 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,296 | fields_small.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/fields_small.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 17,405 | Python | .py | 442 | 28.067873 | 91 | 0.500266 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,297 | sections.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/sections.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 19,942 | Python | .py | 511 | 29.011742 | 83 | 0.532749 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,298 | make_lists.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/make_lists.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 18,062 | Python | .py | 444 | 29.362613 | 93 | 0.505995 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
27,299 | line_endings.py | kovidgoyal_calibre/src/calibre/ebooks/rtf2xml/line_endings.py | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 2,304 | Python | .py | 50 | 39.14 | 73 | 0.455758 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |