Remove integerTypes, it's just an int now
This commit is contained in:
parent
9825553e06
commit
20b1e06100
@ -33,7 +33,7 @@ from fontTools.ufoLib.validators import (
|
||||
)
|
||||
from fontTools.misc import etree
|
||||
from fontTools.ufoLib import _UFOBaseIO
|
||||
from fontTools.ufoLib.utils import integerTypes, numberTypes
|
||||
from fontTools.ufoLib.utils import numberTypes
|
||||
|
||||
|
||||
__all__ = [
|
||||
@ -681,11 +681,11 @@ def _writeAdvance(glyphObject, element, validate):
|
||||
|
||||
def _writeUnicodes(glyphObject, element, validate):
|
||||
unicodes = getattr(glyphObject, "unicodes", None)
|
||||
if validate and isinstance(unicodes, integerTypes):
|
||||
if validate and isinstance(unicodes, int):
|
||||
unicodes = [unicodes]
|
||||
seen = set()
|
||||
for code in unicodes:
|
||||
if validate and not isinstance(code, integerTypes):
|
||||
if validate and not isinstance(code, int):
|
||||
raise GlifLibError("unicode values must be int")
|
||||
if code in seen:
|
||||
continue
|
||||
|
@ -5,7 +5,6 @@ import warnings
|
||||
import functools
|
||||
|
||||
|
||||
integerTypes = int
|
||||
numberTypes = (int, float)
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@ import fs.base
|
||||
import fs.osfs
|
||||
|
||||
from collections.abc import Mapping
|
||||
from fontTools.ufoLib.utils import integerTypes, numberTypes
|
||||
from fontTools.ufoLib.utils import numberTypes
|
||||
|
||||
|
||||
# -------
|
||||
@ -42,7 +42,7 @@ def genericIntListValidator(values, validValues):
|
||||
if valuesSet - validValuesSet:
|
||||
return False
|
||||
for value in values:
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -50,7 +50,7 @@ def genericNonNegativeIntValidator(value):
|
||||
"""
|
||||
Generic. (Added at version 3.)
|
||||
"""
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
if value < 0:
|
||||
return False
|
||||
@ -207,7 +207,7 @@ def fontInfoOpenTypeOS2WeightClassValidator(value):
|
||||
"""
|
||||
Version 2+.
|
||||
"""
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
if value < 0:
|
||||
return False
|
||||
@ -217,7 +217,7 @@ def fontInfoOpenTypeOS2WidthClassValidator(value):
|
||||
"""
|
||||
Version 2+.
|
||||
"""
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
if value < 1:
|
||||
return False
|
||||
@ -234,7 +234,7 @@ def fontInfoVersion2OpenTypeOS2PanoseValidator(values):
|
||||
if len(values) != 10:
|
||||
return False
|
||||
for value in values:
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
# XXX further validation?
|
||||
return True
|
||||
@ -248,7 +248,7 @@ def fontInfoVersion3OpenTypeOS2PanoseValidator(values):
|
||||
if len(values) != 10:
|
||||
return False
|
||||
for value in values:
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
if value < 0:
|
||||
return False
|
||||
@ -264,7 +264,7 @@ def fontInfoOpenTypeOS2FamilyClassValidator(values):
|
||||
if len(values) != 2:
|
||||
return False
|
||||
for value in values:
|
||||
if not isinstance(value, integerTypes):
|
||||
if not isinstance(value, int):
|
||||
return False
|
||||
classID, subclassID = values
|
||||
if classID < 0 or classID > 14:
|
||||
|
Loading…
x
Reference in New Issue
Block a user