1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

import requests only when really needed

This commit is contained in:
Pavol Rusnak 2016-10-03 10:42:02 +02:00
parent bac91afca7
commit 92810a287f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -291,14 +291,15 @@ class Commands(object):
return ret
def firmware_update(self, args):
import requests
if args.file:
fp = open(args.file, 'rb').read()
elif args.url:
import requests
print("Downloading from", args.url)
r = requests.get(args.url)
fp = r.content
else:
import requests
r = requests.get('https://wallet.trezor.io/data/firmware/releases.json')
releases = r.json()
version = lambda r: r['version']