1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00

disable filecache by default

This commit is contained in:
Pavol Rusnak 2015-02-22 14:38:33 +01:00
parent 3358906c65
commit 049166d6c9
2 changed files with 6 additions and 5 deletions

View File

@ -3,7 +3,7 @@ from setuptools import setup
setup( setup(
name='trezor', name='trezor',
version='0.6.2', version='0.6.3',
author='Bitcoin TREZOR', author='Bitcoin TREZOR',
author_email='info@bitcointrezor.com', author_email='info@bitcointrezor.com',
description='Python library for communicating with TREZOR Bitcoin Hardware Wallet', description='Python library for communicating with TREZOR Bitcoin Hardware Wallet',

View File

@ -3,13 +3,14 @@ import urllib2
import json import json
from decimal import Decimal from decimal import Decimal
try: try:
from filecache import filecache, MONTH raise Exception() # remove this line to enable caching
from filecache import filecache, DAY
except: except:
def filecache(x): def filecache(x):
def _inner(y): def _inner(y):
return y return y
return _inner return _inner
MONTH = None DAY = None
import types_pb2 as proto_types import types_pb2 as proto_types
@ -89,14 +90,14 @@ def insight_tx(url):
class TXAPIBitcoin(object): class TXAPIBitcoin(object):
@filecache(MONTH) @filecache(DAY)
def get_tx(self, txhash): def get_tx(self, txhash):
url = 'https://insight.bitpay.com/api/tx/%s' % txhash url = 'https://insight.bitpay.com/api/tx/%s' % txhash
return insight_tx(url) return insight_tx(url)
class TXAPITestnet(object): class TXAPITestnet(object):
@filecache(MONTH) @filecache(DAY)
def get_tx(self, txhash): def get_tx(self, txhash):
url = 'https://test-insight.bitpay.com/api/tx/%s' % txhash url = 'https://test-insight.bitpay.com/api/tx/%s' % txhash
return insight_tx(url) return insight_tx(url)