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)
|
package = get_object_or_404(Package, category=category, name=package)
|
||||||
packaged = Version.objects.filter(package=package, packaged=True)
|
packaged = Version.objects.filter(package=package, packaged=True)
|
||||||
upstream = Version.objects.filter(package=package, packaged=False)
|
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')
|
@render_to('euscan/world.html')
|
||||||
def world(request):
|
def world(request):
|
||||||
@ -85,12 +88,18 @@ def world_scan(request):
|
|||||||
else:
|
else:
|
||||||
data = ""
|
data = ""
|
||||||
|
|
||||||
|
data = data.replace("\r", "")
|
||||||
|
|
||||||
for pkg in data.split('\n'):
|
for pkg in data.split('\n'):
|
||||||
try:
|
try:
|
||||||
|
if '/' in pkg:
|
||||||
cat, pkg = pkg.split('/')
|
cat, pkg = pkg.split('/')
|
||||||
packages.append(Package.objects.get(category=cat, name=pkg))
|
packages.extend(Package.objects.filter(category=cat, name=pkg))
|
||||||
|
else:
|
||||||
|
packages.extend(Package.objects.filter(name=pkg))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
print packages
|
||||||
|
|
||||||
return { 'packages' : packages }
|
return { 'packages' : packages }
|
||||||
|
|
||||||
|
@ -69,5 +69,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if log %}
|
||||||
|
<dt>euscan log</dt>
|
||||||
|
<dd>
|
||||||
|
<p>Date: {{ log.datetime }}
|
||||||
|
<pre>
|
||||||
|
{{ log.result }}
|
||||||
|
</pre>
|
||||||
|
</dd>
|
||||||
|
{% endif %}
|
||||||
</dl>
|
</dl>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user