#!/usr/bin/python2 import sys import re import hashlib import os from versions import version, version_win, version_mac from versions import download_template, download_page with open(download_template) as f: string = f.read() string = string.replace("##VERSION##", version) string = string.replace("##VERSION_WIN##", version_win) string = string.replace("##VERSION_MAC##", version_mac) files = { 'tgz': "Electrum-%s.tar.gz" % version, 'zip': "Electrum-%s.zip" % version, 'mac': "electrum-%s.dmg" % version_mac, 'win': "electrum-%s.exe" % version_win, 'win_setup': "electrum-%s-setup.exe" % version_win, 'win_portable': "electrum-%s-portable.exe" % version_win, } for k, n in files.items(): path = "dist/%s"%n link = "https://download.electrum.org/%s/%s"%(version,n) if not os.path.exists(path): os.system("wget -q %s -O %s" % (link, path)) if not os.path.getsize(path): os.unlink(path) string = re.sub("