This commit is contained in:
Kovid Goyal 2014-03-03 19:45:00 +05:30
parent 54b4d5b329
commit 6df7412bbc

View File

@ -36,13 +36,11 @@ class DJVUInput(InputFormatPlugin):
setattr(options, opt.option.name, opt.recommended_value)
options.input_encoding = 'utf-8'
base = os.getcwdu()
if file_ext != 'txtz' and hasattr(stream, 'name'):
base = os.path.dirname(stream.name)
fname = os.path.join(base, 'index.html')
c = 0
while os.path.exists(fname):
c += 1
fname = 'index%d.html'%c
fname = os.path.join(base, 'index%d.html'%c)
htmlfile = open(fname, 'wb')
with htmlfile:
htmlfile.write(html.encode('utf-8'))