mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-25 03:32:02 +02:00
name-parser: Fix Python2 compatibility
[why] The naming has bizarre blanks strewn in sometimes, or is all caps. For example `C a s k a y d i a C o v e` or `CASKAYDIACOVE-Regular` [how] When run under Python2 all strings are unicode strings because `unicode_literals` is imported by `font-patcher`. Unfortunately the code checks for type str; but that will all become type unicode with the import. One check is suboptimal anyhow and can be dropped, while the other is turned around. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
c92396150d
commit
080a86e966
@ -95,7 +95,7 @@ class FontnameParser:
|
||||
"""Enable short styles in Family when (original) font name starts with prefix; enable CamelCase basename in (Typog.) Family"""
|
||||
# camelcase_name is boolean
|
||||
# prefix is either a string or False
|
||||
if type(prefix) == str:
|
||||
if prefix:
|
||||
prefix = self._basename.startswith(prefix)
|
||||
self.use_short_families = ( camelcase_name, prefix )
|
||||
return self
|
||||
|
@ -52,7 +52,7 @@ class FontnameTools:
|
||||
"""Flatten list of (strings or lists of strings) to a blank-separated string"""
|
||||
all = []
|
||||
for thing in all_things:
|
||||
if type(thing) == str:
|
||||
if type(thing) is not list:
|
||||
all.append(thing)
|
||||
else:
|
||||
all += thing
|
||||
|
Loading…
x
Reference in New Issue
Block a user