18 lines
443 B
Python
18 lines
443 B
Python
|
# standard imports
|
|||
|
import urllib.request
|
|||
|
import urllib.parse
|
|||
|
|
|||
|
|
|||
|
class TxGetter:
|
|||
|
|
|||
|
|
|||
|
def __init__(self, cache_url, limit=0):
|
|||
|
self.cache_url = cache_url
|
|||
|
self.limit = limit
|
|||
|
|
|||
|
if limit == 0:
|
|||
|
url = urllib.parse.urljoin(self.cache_url, 'defaultlimit')
|
|||
|
r = urllib.request.urlopen(url)
|
|||
|
self.limit = r.read()
|
|||
|
logg.debug('set limit {} from {}'.format(self.limit, self.cache_url))
|