1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-17 19:00:58 +00:00

trezorctl: bad call to click.echo (fixes #304)

This commit is contained in:
matejcik 2018-10-03 16:28:01 +02:00
parent 2d7c74c535
commit 2b02af1126

View File

@ -96,6 +96,7 @@ class UnderscoreAgnosticGroup(click.Group):
This implementation of `click.Group` responds to underscore_commands by invoking This implementation of `click.Group` responds to underscore_commands by invoking
the respective dash-command. the respective dash-command.
""" """
def get_command(self, ctx, cmd_name): def get_command(self, ctx, cmd_name):
cmd = super().get_command(ctx, cmd_name) cmd = super().get_command(ctx, cmd_name)
if cmd is None: if cmd is None:
@ -522,18 +523,14 @@ def firmware_update(connect, filename, url, version, skip_check, fingerprint):
elif url: elif url:
import requests import requests
click.echo("Downloading from", url) click.echo("Downloading from {}".format(url))
r = requests.get(url) r = requests.get(url)
fp = r.content fp = r.content
else: else:
import requests import requests
r = requests.get( url = "https://wallet.trezor.io/data/firmware/{}/releases.json"
"https://wallet.trezor.io/data/firmware/{}/releases.json".format( releases = requests.get(url.format(firmware_version)).json()
firmware_version
)
)
releases = r.json()
def version_func(r): def version_func(r):
return r["version"] return r["version"]