euscanwww: fix 'world' and add the last log on the package view
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
parent
9c13c22c5e
commit
46eb0e9e2a
@ -63,7 +63,10 @@ def package(request, category, package):
|
||||
package = get_object_or_404(Package, category=category, name=package)
|
||||
packaged = Version.objects.filter(package=package, packaged=True)
|
||||
upstream = Version.objects.filter(package=package, packaged=False)
|
||||
return { 'package' : package, 'packaged' : packaged, 'upstream' : upstream }
|
||||
log = EuscanResult.objects.filter(package=package).order_by('-datetime')[:1]
|
||||
log = log[0] if log else None
|
||||
return { 'package' : package, 'packaged' : packaged,
|
||||
'upstream' : upstream, 'log' : log }
|
||||
|
||||
@render_to('euscan/world.html')
|
||||
def world(request):
|
||||
@ -85,12 +88,18 @@ def world_scan(request):
|
||||
else:
|
||||
data = ""
|
||||
|
||||
data = data.replace("\r", "")
|
||||
|
||||
for pkg in data.split('\n'):
|
||||
try:
|
||||
cat, pkg = pkg.split('/')
|
||||
packages.append(Package.objects.get(category=cat, name=pkg))
|
||||
if '/' in pkg:
|
||||
cat, pkg = pkg.split('/')
|
||||
packages.extend(Package.objects.filter(category=cat, name=pkg))
|
||||
else:
|
||||
packages.extend(Package.objects.filter(name=pkg))
|
||||
except:
|
||||
pass
|
||||
print packages
|
||||
|
||||
return { 'packages' : packages }
|
||||
|
||||
|
@ -69,5 +69,14 @@
|
||||
</ul>
|
||||
</dd>
|
||||
{% endif %}
|
||||
{% if log %}
|
||||
<dt>euscan log</dt>
|
||||
<dd>
|
||||
<p>Date: {{ log.datetime }}
|
||||
<pre>
|
||||
{{ log.result }}
|
||||
</pre>
|
||||
</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user