contrib/add_cosigner: replace old-style format strings with f-strings
This commit is contained in:
@@ -35,30 +35,30 @@ print("version", ELECTRUM_VERSION)
|
|||||||
# GPG names of cosigner
|
# GPG names of cosigner
|
||||||
cosigner = sys.argv[1]
|
cosigner = sys.argv[1]
|
||||||
|
|
||||||
version = version_win = version_mac = version_android = ELECTRUM_VERSION
|
version = version_win = version_mac = ELECTRUM_VERSION
|
||||||
|
|
||||||
files = {
|
files = {
|
||||||
'tgz': "Electrum-%s.tar.gz" % version,
|
"tgz": f"Electrum-{version}.tar.gz",
|
||||||
'appimage': "electrum-%s-x86_64.AppImage" % version,
|
"appimage": f"electrum-{version}-x86_64.AppImage",
|
||||||
'mac': "electrum-%s.dmg" % version_mac,
|
"mac": f"electrum-{version_mac}.dmg",
|
||||||
'win': "electrum-%s.exe" % version_win,
|
"win": f"electrum-{version_win}.exe",
|
||||||
'win_setup': "electrum-%s-setup.exe" % version_win,
|
"win_setup": f"electrum-{version_win}-setup.exe",
|
||||||
'win_portable': "electrum-%s-portable.exe" % version_win,
|
"win_portable": f"electrum-{version_win}-portable.exe",
|
||||||
'apk_arm64': "Electrum-%s-arm64-v8a-release.apk" % APK_VERSION,
|
"apk_arm64": f"Electrum-{APK_VERSION}-arm64-v8a-release.apk",
|
||||||
'apk_armeabi': "Electrum-%s-armeabi-v7a-release.apk" % APK_VERSION,
|
"apk_armeabi": f"Electrum-{APK_VERSION}-armeabi-v7a-release.apk",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for k, n in files.items():
|
for shortname, filename in files.items():
|
||||||
path = "dist/%s"%n
|
path = f"dist/{filename}"
|
||||||
link = "https://download.electrum.org/%s/%s"%(version,n)
|
link = f"https://download.electrum.org/{version}/{filename}"
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
os.system("wget -q %s -O %s" % (link, path))
|
os.system(f"wget -q {link} -O {path}")
|
||||||
if not os.path.getsize(path):
|
if not os.path.getsize(path):
|
||||||
raise Exception(path)
|
raise Exception(path)
|
||||||
sig_name = n + '.'+cosigner+'.asc'
|
sig_name = f"{filename}.{cosigner}.asc"
|
||||||
sig_url = "https://raw.githubusercontent.com/spesmilo/electrum-signatures/master/%s/%s/%s"%(version, n, sig_name)
|
sig_url = f"https://raw.githubusercontent.com/spesmilo/electrum-signatures/master/{version}/{filename}/{sig_name}"
|
||||||
sig_path = "dist/%s"% sig_name
|
sig_path = f"dist/{sig_name}"
|
||||||
os.system("wget -nc %s -O %s"%(sig_url, sig_path))
|
os.system(f"wget -nc {sig_url} -O {sig_path}")
|
||||||
if os.system("gpg --verify %s %s"%(sig_path, path)) != 0:
|
if os.system(f"gpg --verify {sig_path} {path}") != 0:
|
||||||
raise Exception(sig_name)
|
raise Exception(sig_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user