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
4103e614
Commit
4103e614
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Handle autoping and autoclose parameters
parent
e8190277
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ucoinpy/api/bma/__init__.py
+2
-2
2 additions, 2 deletions
ucoinpy/api/bma/__init__.py
ucoinpy/api/bma/ws/__init__.py
+4
-4
4 additions, 4 deletions
ucoinpy/api/bma/ws/__init__.py
with
6 additions
and
6 deletions
ucoinpy/api/bma/__init__.py
+
2
−
2
View file @
4103e614
...
...
@@ -184,7 +184,7 @@ class API(object):
response
=
await
aiohttp
.
post
(
self
.
reverse_url
(
"
http
"
,
path
),
data
=
kwargs
,
headers
=
self
.
headers
)
return
response
def
connect_ws
(
self
,
path
):
def
connect_ws
(
self
,
path
,
autoping
=
True
,
autoclose
=
True
):
"""
Connect to a websocket in order to use API parameters
...
...
@@ -192,7 +192,7 @@ class API(object):
:return:
"""
url
=
self
.
reverse_url
(
"
ws
"
,
path
)
return
aiohttp
.
ws_connect
(
url
)
return
aiohttp
.
ws_connect
(
url
,
autoping
=
autoping
,
autoclose
=
autoclose
)
from
.
import
network
,
blockchain
,
tx
,
wot
,
node
,
ud
,
ws
This diff is collapsed.
Click to expand it.
ucoinpy/api/bma/ws/__init__.py
+
4
−
4
View file @
4103e614
...
...
@@ -32,8 +32,8 @@ class Block(Websocket):
"""
Connect to block websocket.
"""
schema
=
_Block
.
schema
def
connect
(
self
):
r
=
self
.
connect_ws
(
'
/block
'
)
def
connect
(
self
,
autoping
=
True
,
autoclose
=
True
):
r
=
self
.
connect_ws
(
'
/block
'
,
autoping
=
autoping
,
autoclose
=
autoclose
)
return
r
...
...
@@ -64,6 +64,6 @@ class Peer(Websocket):
"
required
"
:
[
"
version
"
,
"
currency
"
,
"
pubkey
"
,
"
endpoints
"
,
"
signature
"
]
}
def
connect
(
self
):
r
=
self
.
connect_ws
(
'
/peer
'
)
def
connect
(
self
,
autoping
=
True
,
autoclose
=
True
):
r
=
self
.
connect_ws
(
'
/peer
'
,
autoping
=
autoping
,
autoclose
=
autoclose
)
return
r
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