1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-19 12:43:35 +02:00

Moved misc functions from polyglot package to single polyglot module.

This commit is contained in:
2021-05-25 19:06:31 +02:00
parent f46984267e
commit f47376830f
32 changed files with 244 additions and 219 deletions

View File

@@ -9,7 +9,7 @@ import sys
import urllib.parse
from ebook_converter.utils.config_base import tweaks
from ebook_converter.polyglot.urllib import unquote
from ebook_converter import polyglot
from ebook_converter.utils import encoding as uenc
@@ -248,9 +248,11 @@ class Resource(object):
pc = url[2]
if isinstance(pc, str):
pc = pc.encode('utf-8')
pc = unquote(pc).decode('utf-8')
self.path = os.path.abspath(os.path.join(basedir, pc.replace('/', os.sep)))
self.fragment = unquote(url[-1])
pc = polyglot.unquote(pc).decode('utf-8')
self.path = os.path.abspath(os.path.join(basedir,
pc.replace('/',
os.sep)))
self.fragment = polyglot.unquote(url[-1])
def href(self, basedir=None):
'''