Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Commits
2c30fdfd
Commit
2c30fdfd
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Various bug fixes
parent
8147cb96
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ucoinpy/api/bma/__init__.py
+4
-2
4 additions, 2 deletions
ucoinpy/api/bma/__init__.py
ucoinpy/documents/block.py
+3
-2
3 additions, 2 deletions
ucoinpy/documents/block.py
ucoinpy/documents/certification.py
+1
-1
1 addition, 1 deletion
ucoinpy/documents/certification.py
with
8 additions
and
5 deletions
ucoinpy/api/bma/__init__.py
+
4
−
2
View file @
2c30fdfd
...
@@ -109,7 +109,8 @@ class API(object):
...
@@ -109,7 +109,8 @@ class API(object):
- `path`: the request path
- `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
:
if
response
.
status_code
!=
200
:
raise
ValueError
(
'
status code != 200 => %d (%s)
'
%
(
response
.
status_code
,
response
.
text
))
raise
ValueError
(
'
status code != 200 => %d (%s)
'
%
(
response
.
status_code
,
response
.
text
))
...
@@ -127,7 +128,8 @@ class API(object):
...
@@ -127,7 +128,8 @@ class API(object):
kwargs
[
'
self
'
]
=
kwargs
.
pop
(
'
self_
'
)
kwargs
[
'
self
'
]
=
kwargs
.
pop
(
'
self_
'
)
logging
.
debug
(
"
POST : {0}
"
.
format
(
kwargs
))
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
:
if
response
.
status_code
!=
200
:
raise
ValueError
(
'
status code != 200 => %d (%s)
'
%
(
response
.
status_code
,
response
.
text
))
raise
ValueError
(
'
status code != 200 => %d (%s)
'
%
(
response
.
status_code
,
response
.
text
))
...
...
This diff is collapsed.
Click to expand it.
ucoinpy/documents/block.py
+
3
−
2
View file @
2c30fdfd
...
@@ -73,6 +73,7 @@ BOTTOM_SIGNATURE
...
@@ -73,6 +73,7 @@ BOTTOM_SIGNATURE
re_actives
=
re
.
compile
(
"
Actives:
\n
"
)
re_actives
=
re
.
compile
(
"
Actives:
\n
"
)
re_leavers
=
re
.
compile
(
"
Leavers:
\n
"
)
re_leavers
=
re
.
compile
(
"
Leavers:
\n
"
)
re_excluded
=
re
.
compile
(
"
Excluded:
\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_certifications
=
re
.
compile
(
"
Certifications:
\n
"
)
re_transactions
=
re
.
compile
(
"
Transactions:
\n
"
)
re_transactions
=
re
.
compile
(
"
Transactions:
\n
"
)
...
@@ -197,7 +198,7 @@ BOTTOM_SIGNATURE
...
@@ -197,7 +198,7 @@ BOTTOM_SIGNATURE
if
Block
.
re_excluded
.
match
(
lines
[
n
]):
if
Block
.
re_excluded
.
match
(
lines
[
n
]):
n
=
n
+
1
n
=
n
+
1
while
Block
.
re_certifications
.
match
(
lines
[
n
])
is
None
:
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
)
excluded
.
append
(
membership
)
n
=
n
+
1
n
=
n
+
1
...
@@ -282,7 +283,7 @@ PreviousIssuer: {1}\n".format(self.prev_hash, self.prev_issuer)
...
@@ -282,7 +283,7 @@ PreviousIssuer: {1}\n".format(self.prev_hash, self.prev_issuer)
doc
+=
"
Excluded:
\n
"
doc
+=
"
Excluded:
\n
"
for
exclude
in
self
.
excluded
:
for
exclude
in
self
.
excluded
:
doc
+=
"
{0}
\n
"
.
format
(
exclude
.
inline
()
)
doc
+=
"
{0}
\n
"
.
format
(
exclude
)
doc
+=
"
Certifications:
\n
"
doc
+=
"
Certifications:
\n
"
for
cert
in
self
.
certifications
:
for
cert
in
self
.
certifications
:
...
...
This diff is collapsed.
Click to expand it.
ucoinpy/documents/certification.py
+
1
−
1
View file @
2c30fdfd
...
@@ -57,7 +57,7 @@ class Certification(Document):
...
@@ -57,7 +57,7 @@ class Certification(Document):
re_timestamp
=
re
.
compile
(
"
META:TS:([0-9]+)-([0-9a-fA-F]{5,40})
\n
"
)
re_timestamp
=
re
.
compile
(
"
META:TS:([0-9]+)-([0-9a-fA-F]{5,40})
\n
"
)
def
__init__
(
self
,
version
,
currency
,
pubkey_from
,
pubkey_to
,
def
__init__
(
self
,
version
,
currency
,
pubkey_from
,
pubkey_to
,
block
hash
,
block
number
,
signature
):
block
number
,
block
hash
,
signature
):
'''
'''
Constructor
Constructor
'''
'''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment