Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix key error for some tox-results #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion devpi_semantic_ui/templates/index.pt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td>
<tal:files condition="package.files" repeat="file package.files">
<tal:file define="toxresults file.get('toxresults', []);
failed None if not toxresults else any(x['failed'] for x in toxresults)">
failed None if not toxresults else any(x.get('failed', False) for x in toxresults)">
<a href="${file.url}">${file.title}</a>
<tal:tests condition="failed is not None">
(<a href="${package.make_toxresults_url(basename=file.basename)}"
Expand Down
4 changes: 2 additions & 2 deletions devpi_semantic_ui/templates/toxresult.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<h1 class="ui header">${title}</h1>

<div tal:repeat="toxresult toxresults"
tal:attributes="class 'toxresult ' + ('failed' if toxresult.failed else 'passed')">
tal:attributes="class 'toxresult ' + ('failed' if getattr(toxresult, 'failed', False) else 'passed')">
<h2 id="${toxresult._key}"
tal:attributes="class 'ui dividing header toxresult_title ' + ('red' if toxresult.failed else 'green')">
tal:attributes="class 'ui dividing header toxresult_title ' + ('red' if getattr(toxresult, 'failed', False) else 'green')">
${toxresult.envname}
&nbsp;
<a class="ui small blue tag label" title="Python version">🐍 ${toxresult.get('pyversion')}</a>
Expand Down
4 changes: 2 additions & 2 deletions devpi_semantic_ui/templates/version.pt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
<a tal:repeat="toxresult file.get('toxresults')"
class="mini ui labeled button" tabindex="0"
href="${make_toxresult_url(basename=file.basename, toxresult=toxresult.basename)}#${toxresult._key}">
<div tal:attributes="class 'mini ui button ' + ('red' if toxresult.failed else 'green')">
<div tal:attributes="class 'mini ui button ' + ('red' if getattr(toxresult, 'failed', False) else 'green')">
${toxresult.envname}
</div>
<span tal:attributes="class 'ui left pointing label ' + ('orange' if toxresult.failed else 'olive')">
<span tal:attributes="class 'ui left pointing label ' + ('orange' if getattr(toxresult, 'failed', False) else 'olive')">
${toxresult.get('pyversion')}
</span>
</a>
Expand Down