1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-01-02 08:32:26 +01:00

Removing polyglot getcwd and getenv

This commit is contained in:
2020-04-20 20:33:25 +02:00
parent c867f0321b
commit 3ca3f08054
29 changed files with 89 additions and 99 deletions

View File

@@ -2,7 +2,6 @@ import os
from ebook_converter import guess_type
from ebook_converter.customize.conversion import InputFormatPlugin
from ebook_converter.polyglot.builtins import getcwd
__license__ = 'GPL 3'
@@ -84,7 +83,7 @@ class HTMLZInput(InputFormatPlugin):
for opt in html_input.options:
setattr(options, opt.option.name, opt.recommended_value)
options.input_encoding = 'utf-8'
base = getcwd()
base = os.getcwd()
htmlfile = os.path.join(base, u'index.html')
c = 0
while os.path.exists(htmlfile):
@@ -115,12 +114,12 @@ class HTMLZInput(InputFormatPlugin):
opf = x
break
if opf:
opf = OPF(opf, basedir=getcwd())
opf = OPF(opf, basedir=os.getcwd())
cover_path = opf.raster_cover or opf.cover
# Set the cover.
if cover_path:
cdata = None
with open(os.path.join(getcwd(), cover_path), 'rb') as cf:
with open(os.path.join(os.getcwd(), cover_path), 'rb') as cf:
cdata = cf.read()
cover_name = os.path.basename(cover_path)
id, href = oeb.manifest.generate('cover', cover_name)