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:
parent
bac91afca7
commit
92810a287f
@ -291,14 +291,15 @@ class Commands(object):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def firmware_update(self, args):
|
def firmware_update(self, args):
|
||||||
import requests
|
|
||||||
if args.file:
|
if args.file:
|
||||||
fp = open(args.file, 'rb').read()
|
fp = open(args.file, 'rb').read()
|
||||||
elif args.url:
|
elif args.url:
|
||||||
|
import requests
|
||||||
print("Downloading from", args.url)
|
print("Downloading from", args.url)
|
||||||
r = requests.get(args.url)
|
r = requests.get(args.url)
|
||||||
fp = r.content
|
fp = r.content
|
||||||
else:
|
else:
|
||||||
|
import requests
|
||||||
r = requests.get('https://wallet.trezor.io/data/firmware/releases.json')
|
r = requests.get('https://wallet.trezor.io/data/firmware/releases.json')
|
||||||
releases = r.json()
|
releases = r.json()
|
||||||
version = lambda r: r['version']
|
version = lambda r: r['version']
|
||||||
|
Loading…
Reference in New Issue
Block a user