mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
rename txcache files to json
This commit is contained in:
parent
23f7feb438
commit
ec966a0111
@ -1,3 +1,3 @@
|
||||
recursive-include tests *.py *.sh
|
||||
recursive-include tests *.py *.sh *.json
|
||||
recursive-include bash_completion.d *.sh
|
||||
include COPYING
|
||||
|
@ -31,9 +31,9 @@ class TxApi(object):
|
||||
self.url = url
|
||||
|
||||
def fetch_json(self, url, resource, resourceid):
|
||||
cachefile = '%s_%s_%s' % (self.network, resource, resourceid)
|
||||
cachefile = 'txcache/%s_%s_%s.json' % (self.network, resource, resourceid)
|
||||
try: # looking into cache first
|
||||
j = json.load(open('txcache/' + cachefile))
|
||||
j = json.load(open(cachefile))
|
||||
return j
|
||||
except:
|
||||
pass
|
||||
@ -43,7 +43,7 @@ class TxApi(object):
|
||||
except:
|
||||
raise Exception('URL error: %s' % url)
|
||||
try: # saving into cache
|
||||
json.dump(j, open('txcache/' + cachefile, 'w'))
|
||||
json.dump(j, open(cachefile, 'w'))
|
||||
except:
|
||||
pass
|
||||
return j
|
||||
|
Loading…
Reference in New Issue
Block a user