py3: Fix compilation of viewer code

This commit is contained in:
Kovid Goyal 2019-08-01 08:38:03 +05:30
parent cd64459718
commit 8cb9dc1ca1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -291,9 +291,9 @@ def compile_viewer():
iconf = os.path.join(base, 'imgsrc', 'srv', 'generate.py') iconf = os.path.join(base, 'imgsrc', 'srv', 'generate.py')
g = {'__file__': iconf} g = {'__file__': iconf}
exec_path(iconf, g) exec_path(iconf, g)
icons = g['merge']().encode('utf-8') icons = g['merge']()
with lopen(os.path.join(base, 'resources', 'content-server', 'reset.css'), 'rb') as f: with lopen(os.path.join(base, 'resources', 'content-server', 'reset.css'), 'rb') as f:
reset = f.read() reset = f.read().decode('utf-8')
html = '<!DOCTYPE html>\n<html><head><style>{reset}</style></head><body>{icons}</body></html>'.format( html = '<!DOCTYPE html>\n<html><head><style>{reset}</style></head><body>{icons}</body></html>'.format(
icons=icons, reset=reset) icons=icons, reset=reset)