summaryrefslogtreecommitdiff
path: root/packages/views/display.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-01-23 09:20:19 -0700
committerDan McGee <dan@archlinux.org>2013-01-23 09:20:19 -0700
commitdc6cc49f6f876983f76f5f8c05a2285801f27ea0 (patch)
tree32499bbeac267cbf463bba992a225d5b9224dcbc /packages/views/display.py
parenta10798b756bbfc5d8dbad76546ca670efca75e56 (diff)
Use more modern verison of string template formatting
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views/display.py')
-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 c2369aba..497c8d48 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: