get_processor_resource_types: be stricter about has_files
@@ -118,7 +118,7 @@ def get_processor_resource_types(executable, ocrd_tool=None):
result = run([executable, '--dump-json'], stdout=PIPE, check=True, universal_newlines=True)
ocrd_tool = loads(result.stdout)
has_dirs = next((True for p in ocrd_tool['parameters'].values() if p.get('content-type', None) == 'text/directory'), False)
- has_files = next((True for p in ocrd_tool['parameters'].values() if p.get('content-type', None) != 'text/directory'), False)
+ has_files = next((True for p in ocrd_tool['parameters'].values() if 'content-type' in p and p['content-type'] != 'text/directory'), False)
return (has_dirs, has_files)
# ht @pabs3
