mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-25 16:01:29 +02:00
Removed polyglots unicode_type usage
This commit is contained in:
@@ -6,7 +6,7 @@ from functools import partial
|
||||
from ebook_converter.utils.icu import safe_chr, ord_string
|
||||
from ebook_converter.utils.fonts.sfnt.container import Sfnt
|
||||
from ebook_converter.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs
|
||||
from ebook_converter.polyglot.builtins import unicode_type, iteritems, itervalues
|
||||
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
@@ -106,7 +106,7 @@ def pdf_subset(sfnt, glyphs):
|
||||
|
||||
|
||||
def safe_ord(x):
|
||||
return ord_string(unicode_type(x))[0]
|
||||
return ord_string(str(x))[0]
|
||||
|
||||
|
||||
def subset(raw, individual_chars, ranges=(), warnings=None):
|
||||
@@ -343,12 +343,12 @@ def all():
|
||||
print('No glyphs!')
|
||||
continue
|
||||
except UnsupportedFont as e:
|
||||
unsupported.append((font['full_name'], font['path'], unicode_type(e)))
|
||||
unsupported.append((font['full_name'], font['path'], str(e)))
|
||||
print('Unsupported!')
|
||||
continue
|
||||
except Exception as e:
|
||||
print('Failed!')
|
||||
failed.append((font['full_name'], font['path'], unicode_type(e)))
|
||||
failed.append((font['full_name'], font['path'], str(e)))
|
||||
else:
|
||||
averages.append(sum(itervalues(new_stats))/sum(itervalues(old_stats)) * 100)
|
||||
print('Reduced to:', '%.1f'%averages[-1] , '%')
|
||||
|
||||
Reference in New Issue
Block a user