Skip to content

Error in wiki template file for --custom-template #1760

Description

@AyanSinhaMahapatra

Description

The error is in the template2.html example template file (Probably just outdated) of this wiki.

Running the following Command
./scancode -clpeui --custom-output sample.json --custom-template template2.html samples

Gives the following Error:

ERROR: failed to run output plugin: template:
Traceback (most recent call last):
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/scancode/cli.py", line 1033, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/formattedcode/output_html.py", line 131, in process_codebase
    write_templated(output_file, results, version, template_loc)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/formattedcode/output_html.py", line 142, in write_templated
    for template_chunk in generate_output(results, version, template):
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/local/lib/python2.7/site-packages/jinja2/environment.py", line 1045, in generate
    yield self.environment.handle_exception(exc_info, True)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/template2.html", line 2, in top-level template code
    {% if results.license_copyright %}
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/local/lib/python2.7/site-packages/jinja2/environment.py", line 430, in getattr
    return getattr(obj, attribute)
UndefinedError: 'results' is undefined

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? Ubuntu 16.04 LTS
  • What version of scancode-toolkit was used to generate the scan file? v3.1.1
  • What installation method was used to install/run scancode? Source Download

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions