Skip to content

Commit

Permalink
Merge 2b54087 into 32afb6b
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Nov 6, 2020
2 parents 32afb6b + 2b54087 commit 19241c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion schema/error_processor.py
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -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",
Expand Down

0 comments on commit 19241c3

Please sign in to comment.