summaryrefslogtreecommitdiffstats
path: root/packages/views
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-01-23 17:20:19 +0100
committerDan McGee <dan@archlinux.org>2013-01-23 17:20:19 +0100
commitdc6cc49f6f876983f76f5f8c05a2285801f27ea0 (patch)
tree32499bbeac267cbf463bba992a225d5b9224dcbc /packages/views
parenta10798b756bbfc5d8dbad76546ca670efca75e56 (diff)
downloadarchweb-dc6cc49f6f876983f76f5f8c05a2285801f27ea0.tar.gz
archweb-dc6cc49f6f876983f76f5f8c05a2285801f27ea0.tar.xz
Use more modern verison of string template formatting
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views')
-rw-r--r--packages/views/display.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/packages/views/display.py b/packages/views/display.py
index c2369ab..497c8d4 100644
--- a/packages/views/display.py
+++ b/packages/views/display.py
@@ -1,6 +1,5 @@
import datetime
import json
-from string import Template
from urllib import urlencode
from django.http import HttpResponse, Http404
@@ -223,12 +222,9 @@ def download(request, name, repo, arch):
# grab the first non-any arch to fake the download path
arch = Arch.objects.exclude(agnostic=True)[0].name
values = {
- 'host': url.url,
- 'arch': arch,
- 'repo': pkg.repo.name.lower(),
- 'file': pkg.filename,
}
- url = Template('${host}${repo}/os/${arch}/${file}').substitute(values)
+ url = '{host}{repo}/os/{arch}/{filename}'.format(host=url.url,
+ repo=pkg.repo.name.lower(), arch=arch, filename=pkg.filename)
return redirect(url)
# vim: set ts=4 sw=4 et: