Skip to content

Commit

Permalink
Merge pull request #105 from IIIF/104_fix2to3
Browse files Browse the repository at this point in the history
Fixes #104 2.0 manifest throws 500 error
  • Loading branch information
glenrobson committed Oct 1, 2020
2 parents f15c81d + 062f4b5 commit c2c6def
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions iiif-presentation-validator.py
Expand Up @@ -75,6 +75,14 @@ def check_manifest(self, data, version, url=None, warnings=[]):
'error': str(e),
'url': url
}
except Exception as e:
infojson = {
'received': data,
'okay': 0,
'error': 'Presentation Validator bug: "{}". Please create a <a href="https://github.com/IIIF/presentation-validator/issues">Validator Issue</a>, including a link to the manifest.'.format(e),
'url': url
}

else:
reader = ManifestReader(data, version=version)
err = None
Expand Down
2 changes: 2 additions & 0 deletions index.html
Expand Up @@ -128,6 +128,8 @@ <h3>Validation Results:</h3>
url: $("input[name='url']").val(),
version: $("select[name='version']").val()
}
$('#results-content').html('Processing ' + data.version + " validation...");
$('#results').show();
var url = $('#manifest-validation-form').attr("action");
$.getJSON(url,data,handleValidationResponse);
}
Expand Down
6 changes: 5 additions & 1 deletion schema/error_processor.py
Expand Up @@ -295,7 +295,11 @@ def isTypeMatch(self, iiifPath, iiif_asset, schemaType, IIIFJsonPath):

#print ('JsonPath: {}'.format(iiifPath))
path = parse(iiifPath)
typeValue = path.find(iiif_asset)[0].value
results = path.find(iiif_asset)
if not results:
# type not found so return True as this maybe the correct error
return True
typeValue = results[0].value
#print ('Found type {} and schemaType {}'.format(typeValue, schemaType))
if isinstance(schemaType, list):
for typeOption in schemaType:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -57,7 +57,8 @@ def run(self):
"Pillow==6.2.2",
"zipp==1.2.0",
"configparser==4.0.2",
"pyld==1.0.5"
"pyld==1.0.5",
"pyrsistent==0.16.0"
],
},
test_suite="tests",
Expand Down

0 comments on commit c2c6def

Please sign in to comment.