1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-01-08 04:34:12 +01:00

Removing is_py3 method and duplicated by urllib.

This commit is contained in:
2020-04-19 21:22:24 +02:00
parent b66cbd2c1e
commit ef7e2b10be
35 changed files with 267 additions and 254 deletions

View File

@@ -1,7 +1,7 @@
import re
import html.entities
from ebook_converter.polyglot.builtins import codepoint_to_chr
from ebook_converter.polyglot.html_entities import name2codepoint
from ebook_converter.constants import plugins, preferred_encoding
@@ -77,7 +77,8 @@ def unescape(text, rm=False, rchar=''):
else:
# named entity
try:
text = codepoint_to_chr(name2codepoint[text[1:-1]])
text = codepoint_to_chr(html.entities
.name2codepoint[text[1:-1]])
except KeyError:
pass
if rm:

View File

@@ -1,10 +1,16 @@
import os, errno, sys
from threading import Thread
import errno
import functools
import os
import sys
import threading
from ebook_converter import force_unicode
from ebook_converter.constants import iswindows, get_windows_username, islinux, filesystem_encoding, ispy3
from ebook_converter.constants import filesystem_encoding
from ebook_converter.constants import get_windows_username
from ebook_converter.constants import islinux
from ebook_converter.constants import ispy3
from ebook_converter.constants import iswindows
from ebook_converter.utils.filenames import ascii_filename
from ebook_converter.polyglot.functools import lru_cache
__license__ = 'GPL v3'
@@ -24,7 +30,7 @@ def eintr_retry_call(func, *args, **kwargs):
raise
@lru_cache()
@functools.lru_cache()
def socket_address(which):
if iswindows:
ans = r'\\.\pipe\Calibre' + which
@@ -58,12 +64,12 @@ def viewer_socket_address():
return socket_address('Viewer' if iswindows else 'viewer')
class RC(Thread):
class RC(threading.Thread):
def __init__(self, print_error=True, socket_address=None):
self.print_error = print_error
self.socket_address = socket_address or gui_socket_address()
Thread.__init__(self)
threading.Thread.__init__(self)
self.conn = None
self.daemon = True