From c4d9871bd6fbd0c811d35b1d9efc58a3ab6dcbcf Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 6 Nov 2020 00:22:13 +0000 Subject: [PATCH 1/3] Fixing bug where validation errors for manifests with over 10 pages failed --- schema/error_processor.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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: From 289421c6b7a401704babd4da8dca9079c8b20029 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 6 Nov 2020 00:59:20 +0000 Subject: [PATCH 2/3] Pinning Pillow for python 3.5 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 46a8e49..cdfa4d0 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", From 2b54087e43dc3fdb5f5cbc0b1b31f77e94ad89e9 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 6 Nov 2020 01:26:10 +0000 Subject: [PATCH 3/3] Adding missing equals --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cdfa4d0..e13733e 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ def run(self): ], extras_require={ ':python_version>="3.6"': ["Pillow>=3.2.0"], - ':python_version=="3.5"': ["Pillow=7.2.0"], + ':python_version=="3.5"': ["Pillow==7.2.0"], ':python_version<"3.0"': [ "Pillow==6.2.2", "zipp==1.2.0",