Skip to content

Commit

Permalink
Revert "#76: added package and file information to html output"
Browse files Browse the repository at this point in the history
This reverts commit 9135a47.
  • Loading branch information
pombredanne committed Dec 7, 2015
1 parent fd4593d commit fc648a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 98 deletions.
17 changes: 2 additions & 15 deletions src/scancode/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ def as_html(detected_data):
template = get_html_template('html')

converted = OrderedDict()
converted_infos = OrderedDict()
converted_packages = OrderedDict()
licenses = {}

# Create a dict keyed by location
Expand All @@ -160,22 +158,11 @@ def as_html(detected_data):

if entry['key'] not in licenses:
licenses[entry['key']] = entry

if results:
converted[location] = sorted(results, key=itemgetter('start'))

if 'infos' in scan_result:
converted_infos[location] = scan_result['infos']

if 'packages' in scan_result:
converted_packages[location] = scan_result['packages']

licenses = OrderedDict(sorted(licenses.items()))

results = {
"license_copyright": converted,
"infos": converted_infos,
"packages": converted_packages
}

return template.render(results=results, licenses=licenses)
return template.render(results=converted, licenses=licenses)

84 changes: 1 addition & 83 deletions src/scancode/templates/html/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
</style>
</head>
<body>
{% if results.license_copyright %}
<table>
<thead>
<tr>
Expand All @@ -76,7 +75,7 @@
</tr>
</thead>
<tbody>
{% for location, data in results.license_copyright.items() %}
{% for location, data in results.items() %}
{% for row in data %}
<tr>
<td>{{ location }}</td>
Expand All @@ -93,87 +92,6 @@
{% endfor %}
</tbody>
</table>
{% endif %}

{% if results.infos %}
<table>
<caption>File Information</caption>
<thead>
<tr>
<th>location</th>
<th>type</th>
<th>name</th>
<th>extension</th>
<th>date</th>
<th>size</th>
<th>sha1</th>
<th>md5</th>
<th>files_count</th>
<th>mime_type</th>
<th>file_type</th>
<th>programming_language</th>
<th>is_binary</th>
<th>is_text</th>
<th>is_archive</th>
<th>is_media</th>
<th>is_source</th>
<th>is_script</th>
</tr>
</thead>
<tbody>
{% for location, data in results.infos.items() %}
{% for row in data %}
<tr>
<td>{{ location }}</td>
<td>{{ row.type }}</td>
<td>{{ row.name }}</td>
<td>{{ row.extension }}</td>
<td>{{ row.date }}</td>
<td>{{ row.size }}</td>
<td>{{ row.sha1 }}</td>
<td>{{ row.md5 }}</td>
<td>{{ row.file_count }}</td>
<td>{{ row.mime_type }}</td>
<td>{{ row.file_type }}</td>
<td>{{ row.programming_language }}</td>
<td>{{ row.is_binary }}</td>
<td>{{ row.is_text }}</td>
<td>{{ row.is_archive }}</td>
<td>{{ row.is_media }}</td>
<td>{{ row.is_source }}</td>
<td>{{ row.is_script }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% endif %}

{% if results.packages %}
<table>
<caption>Package Information</caption>
<thead>
<tr>
<th>location</th>
<th>type</th>
<th>packaging</th>
<th>primary_language</th>
</tr>
</thead>
<tbody>
{% for location, data in results.packages.items() %}
{% for row in data %}
<tr>
<td>{{ location }}</td>
<td>{{ row.type }}</td>
<td>{{ row.packaging }}</td>
<td>{{ row.primary_language }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% endif %}

{% if licenses %}
<table>
Expand Down

0 comments on commit fc648a6

Please sign in to comment.