Skip to content
Snippets Groups Projects
Commit 2c30fdfd authored by inso's avatar inso
Browse files

Various bug fixes

parent 8147cb96
Branches
Tags v1.5.2
No related merge requests found
......@@ -109,7 +109,8 @@ class API(object):
- `path`: the request path
"""
response = requests.get(self.reverse_url(path), params=kwargs, headers=self.headers)
response = requests.get(self.reverse_url(path), params=kwargs,
headers=self.headers, timeout=15)
if response.status_code != 200:
raise ValueError('status code != 200 => %d (%s)' % (response.status_code, response.text))
......@@ -127,7 +128,8 @@ class API(object):
kwargs['self'] = kwargs.pop('self_')
logging.debug("POST : {0}".format(kwargs))
response = requests.post(self.reverse_url(path), data=kwargs, headers=self.headers)
response = requests.post(self.reverse_url(path), data=kwargs, headers=self.headers,
timeout=15)
if response.status_code != 200:
raise ValueError('status code != 200 => %d (%s)' % (response.status_code, response.text))
......
......@@ -73,6 +73,7 @@ BOTTOM_SIGNATURE
re_actives = re.compile("Actives:\n")
re_leavers = re.compile("Leavers:\n")
re_excluded = re.compile("Excluded:\n")
re_exclusion = re.compile("([1-9A-Za-z][^OIl]{42,45})\n")
re_certifications = re.compile("Certifications:\n")
re_transactions = re.compile("Transactions:\n")
......@@ -197,7 +198,7 @@ BOTTOM_SIGNATURE
if Block.re_excluded.match(lines[n]):
n = n + 1
while Block.re_certifications.match(lines[n]) is None:
membership = Membership.from_inline(version, currency, "OUT", lines[n])
membership = Block.re_exclusion.match(lines[n]).group(1)
excluded.append(membership)
n = n + 1
......@@ -282,7 +283,7 @@ PreviousIssuer: {1}\n".format(self.prev_hash, self.prev_issuer)
doc += "Excluded:\n"
for exclude in self.excluded:
doc += "{0}\n".format(exclude.inline())
doc += "{0}\n".format(exclude)
doc += "Certifications:\n"
for cert in self.certifications:
......
......@@ -57,7 +57,7 @@ class Certification(Document):
re_timestamp = re.compile("META:TS:([0-9]+)-([0-9a-fA-F]{5,40})\n")
def __init__(self, version, currency, pubkey_from, pubkey_to,
blockhash, blocknumber, signature):
blocknumber, blockhash, signature):
'''
Constructor
'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment