Informatievlaanderen / OSLO-SpecificationGenerator

Generates HTML specification pages based on RDF vocabularies.
1 stars 7 forks source link

Error when generating AP documentation: no attribute 'overview_contributors' #2

Closed jensscheerlinck closed 7 years ago

jensscheerlinck commented 7 years ago

When running the script to create HTML pages for an application profile, the following error occurs:

Traceback (most recent call last):
  File "./bin/generate_vocabulary.py", line 4, in <module>
    __import__('pkg_resources').run_script('specgen==0.1.1', 'generate_vocabulary.py')
  File "/projects/digimelding/lib/python3.5/site-packages/pkg_resources/__init__.py", line 738, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/projects/digimelding/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1499, in run_script
    exec(code, namespace, namespace)
  File "/projects/digimelding/lib/python3.5/site-packages/specgen-0.1.1-py3.5.egg/EGG-INFO/scripts/generate_vocabulary.py", line 80, in <module>
    process_args()
  File "/projects/digimelding/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/projects/digimelding/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/projects/digimelding/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/projects/digimelding/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/projects/digimelding/lib/python3.5/site-packages/specgen-0.1.1-py3.5.egg/EGG-INFO/scripts/generate_vocabulary.py", line 51, in process_args
    schema_local=schema_local)
  File "/projects/digimelding/lib/python3.5/site-packages/specgen-0.1.1-py3.5.egg/specgen/__init__.py", line 221, in voc_to_ap
    return render_template(fp, schema, schema_local)
  File "/projects/digimelding/lib/python3.5/site-packages/specgen-0.1.1-py3.5.egg/specgen/__init__.py", line 186, in render_template
    software_version=__version__).encode('utf-8')
  File "/projects/digimelding/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/projects/digimelding/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/projects/digimelding/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/projects/digimelding/lib/python3.5/site-packages/specgen-0.1.1-py3.5.egg/specgen/templates/ap/main.j2", line 49, in top-level template code
    {% if record['overview_contributors']['issued'] %}
  File "/projects/digimelding/lib/python3.5/site-packages/jinja2/environment.py", line 411, in getitem
    return obj[argument]
jinja2.exceptions.UndefinedError: 'collections.OrderedDict object' has no attribute 'overview_contributors'

The line in the AP template (main.j2) that generates the error is: {% if record['overview_contributors']['issued'] %}

laurensdv commented 7 years ago

Yes, this is an ugly error message for when the contributor csv is not provided with the argument

--csv_contributor

Should give a proper error message.

laurensdv commented 7 years ago

Cleaned up error message.