diff --git a/i2p2www/__init__.py b/i2p2www/__init__.py index ff1b73ae..e1a572c5 100644 --- a/i2p2www/__init__.py +++ b/i2p2www/__init__.py @@ -16,6 +16,8 @@ except ImportError: from helpers import Pagination +CURRENT_I2P_VERSION = '0.9.4' + TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'pages') STATIC_DIR = os.path.join(os.path.dirname(__file__), 'static') @@ -406,13 +408,17 @@ def downloads_select(file): if (file == 'debian'): return render_template('downloads/debian.html') mirrors=read_mirrors() + data = { + 'version': CURRENT_I2P_VERSION, + 'file': file, + } obj=[] for protocol in mirrors.keys(): a={} a['name']=protocol a['mirrors']=mirrors[protocol] for mirror in a['mirrors']: - mirror['url']=mirror['url'] % file + mirror['url']=mirror['url'] % data obj.append(a) return render_template('downloads/select.html', mirrors=obj, file=file) @@ -423,9 +429,13 @@ def downloads_redirect(protocol, file, mirror): if not protocol in mirrors: abort(404) mirrors=mirrors[protocol] + data = { + 'version': CURRENT_I2P_VERSION, + 'file': file, + } if mirror: - return redirect(mirrors[mirror]['url'] % file) - return redirect(mirrors[randint(0, len(mirrors) - 1)]['url'] % file) + return redirect(mirrors[mirror]['url'] % data) + return redirect(mirrors[randint(0, len(mirrors) - 1)]['url'] % data) ##################### diff --git a/i2p2www/pages/downloads/mirrors b/i2p2www/pages/downloads/mirrors index 82ab9b31..b3368578 100644 --- a/i2p2www/pages/downloads/mirrors +++ b/i2p2www/pages/downloads/mirrors @@ -1,3 +1,4 @@ -{"url": "http://i2p.googlecode.com/files/%s", "org": "Google Code", "org_url": "http://code.google.com", "protocol": "http", "country": "us"} -{"url": "http://golden.mtveurope.org/~yang/i2p_mirror/%s", "org": "VServer.si", "org_url": "http://www.vserver.si", "protocol": "http", "country": "lu"} -{"url": "http://a.mirror.geti2p.net/releases/current/%s", "org": "welterde", "protocol": "http", "country": "de"} +{"url": "http://i2p.googlecode.com/files/%(file)s", "org": "Google Code", "org_url": "http://code.google.com", "protocol": "http", "country": "us"} +{"url": "http://golden.mtveurope.org/~yang/i2p_mirror/%(file)s", "org": "VServer.si", "org_url": "http://www.vserver.si", "protocol": "http", "country": "lu"} +{"url": "http://a.mirror.geti2p.net/releases/current/%(file)s", "org": "welterde", "protocol": "http", "country": "de"} +{"url": "https://launchpad.net/i2p/trunk/%(version)s/+download/%(file)s", "org": "Launchpad", "org_url": "https://launchpad.net", "protocol": "https", "country": "us"}