clicada/clicada/tx.py

18 lines
443 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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))