1- from fontTools .misc .py23 import *
2- try :
3- long
4- except :
5- # py3 has no long
6- long = int
71import time
82from copy import deepcopy
93from Foundation import NSArray
126 NSDecimalNumber , NSString , NSInsetRect , NSNumberFormatter , NSPointInRect , NSMaxY , NSNull , NSWarningAlertStyle , \
137 NSMutableIndexSet , NSSegmentedCell , NSRectFill
148import vanilla
15- from vanilla . py23 import python_method
9+ from objc import python_method
1610from vanilla import dialogs
1711from vanilla .vanillaList import VanillaTableViewSubclass
1812from ufo2fdk .fontInfoData import getAttrWithFallback , dateStringToTimeValue
@@ -1236,9 +1230,7 @@ def openTypeGaspRangeRecordsToUFO(value):
12361230 sorter [ppem ] = item
12371231 records = []
12381232 for ppem , item in sorted (sorter .items ()):
1239- if isinstance (ppem , long ):
1240- ppem = int (ppem )
1241- elif isinstance (ppem , NSDecimalNumber ):
1233+ if isinstance (ppem , NSDecimalNumber ):
12421234 ppem = int (ppem .intValue ())
12431235 behavior = []
12441236 if item ["gridfit" ]:
@@ -1259,9 +1251,7 @@ def openTypeGaspRangeRecordsInputValidator(records):
12591251 ppems = []
12601252 for record in records :
12611253 ppem = record ["ppem" ]
1262- if isinstance (ppem , long ):
1263- ppem = int (ppem )
1264- elif isinstance (ppem , NSDecimalNumber ):
1254+ if isinstance (ppem , NSDecimalNumber ):
12651255 ppem = int (ppem .intValue ())
12661256 if ppem in ppems :
12671257 return False , "A duplicate PPEM %d record has been created." % ppem , "Duplicate PPEM records aren't allowed. Only the final PPEM %d record will be stored in the font." % ppem
@@ -3708,8 +3698,6 @@ def _controlEditCallback(self, sender):
37083698 pass
37093699 elif isinstance (value , NSArray ):
37103700 value = list (value )
3711- elif isinstance (value , long ):
3712- value = int (value )
37133701 if conversionFunction is not None :
37143702 value = conversionFunction (value )
37153703 # set
0 commit comments