diff --git a/schema/error_processor.py b/schema/error_processor.py index 4bf4ddf..4b75207 100755 --- a/schema/error_processor.py +++ b/schema/error_processor.py @@ -302,12 +302,20 @@ def isTypeMatch(self, iiifPath, iiif_asset, schemaType, IIIFJsonPath): if isinstance(item, int): indexes.append(item) count = 0 + #print (iiifPath) + indexDelta = 0 for index in find(iiifPath, '_'): + index += indexDelta #print ('Replacing {} with {}'.format(iiifPath[index], indexes[count])) iiifPath = iiifPath[:index] + str(indexes[count]) + iiifPath[index + 1:] + # if you replace [_] with a number greater than 9 you are taking up two spaces in the + # string so the index in the for loop starts to be off by one. Calculating the delta + # sorts this out + if len(str(indexes[count])) > 1: + indexDelta += len(str(indexes[count])) -1 count += 1 - #print ('JsonPath: {}'.format(iiifPath)) + #print ('JsonPath: {} IIIF Path {} '.format(iiifPath, IIIFJsonPath)) path = parse(iiifPath) results = path.find(iiif_asset) if not results: diff --git a/setup.py b/setup.py index 46a8e49..e13733e 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,8 @@ def run(self): 'requests' ], extras_require={ - ':python_version>="3.0"': ["Pillow>=3.2.0"], + ':python_version>="3.6"': ["Pillow>=3.2.0"], + ':python_version=="3.5"': ["Pillow==7.2.0"], ':python_version<"3.0"': [ "Pillow==6.2.2", "zipp==1.2.0",