Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
silkaj
Commits
194ee898
Commit
194ee898
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#396
: Remove aiohttp module usage
parent
2e173c93
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
silkaj/blocks.py
+0
-4
0 additions, 4 deletions
silkaj/blocks.py
silkaj/commands.py
+1
-13
1 addition, 13 deletions
silkaj/commands.py
with
1 addition
and
17 deletions
silkaj/blocks.py
+
0
−
4
View file @
194ee898
...
...
@@ -17,7 +17,6 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
import
logging
from
aiohttp.client_exceptions
import
ServerDisconnectedError
from
click
import
INT
,
argument
,
command
,
progressbar
from
duniterpy.api
import
bma
from
duniterpy.api.client
import
Client
...
...
@@ -89,9 +88,6 @@ def get_chunk_size(from_block, to_block, chunks_from, chunk_from):
def
get_chunk
(
client
,
chunk_size
,
chunk_from
):
try
:
return
client
(
bma
.
blockchain
.
blocks
,
chunk_size
,
chunk_from
)
except
ServerDisconnectedError
:
logging
.
info
(
"
Reach BMA anti-spam protection. Waiting two seconds
"
)
return
client
(
bma
.
blockchain
.
blocks
,
chunk_size
,
chunk_from
)
except
DuniterError
as
error
:
logging
.
error
(
error
)
...
...
This diff is collapsed.
Click to expand it.
silkaj/commands.py
+
1
−
13
View file @
194ee898
...
...
@@ -20,9 +20,7 @@ from collections import OrderedDict
from
operator
import
itemgetter
from
os
import
system
import
aiohttp
import
jsonschema
from
_socket
import
gaierror
from
click
import
IntRange
,
argument
,
command
,
option
from
duniterpy.api
import
bma
from
pendulum
import
from_timestamp
...
...
@@ -31,13 +29,8 @@ from tabulate import tabulate
from
silkaj.blockchain_tools
import
HeadBlock
from
silkaj.constants
import
ALL
,
HOUR
from
silkaj.network_tools
import
ClientInstance
,
EndPoint
,
best_endpoint_address
from
silkaj.wot_tools
import
identity_of
from
silkaj.network_tools
import
(
best_endpoint_address
,
EndPoint
,
ClientInstance
,
)
from
silkaj.tools
import
CurrencySymbol
from
silkaj.wot_tools
import
identity_of
@command
(
"
info
"
,
help
=
"
Display information about currency
"
)
...
...
@@ -103,11 +96,6 @@ def difficulties():
diffi
=
client
(
bma
.
blockchain
.
difficulties
)
display_diffi
(
current
,
diffi
)
client
.
close
()
except
(
aiohttp
.
WSServerHandshakeError
,
ValueError
)
as
e
:
print
(
"
Websocket block {0} : {1}
"
.
format
(
type
(
e
).
__name__
,
str
(
e
)))
except
(
aiohttp
.
ClientError
,
gaierror
,
TimeoutError
)
as
e
:
print
(
"
{0} : {1}
"
.
format
(
str
(
e
),
BMAS_ENDPOINT
))
except
jsonschema
.
ValidationError
as
e
:
print
(
"
{:}:{:}
"
.
format
(
str
(
e
.
__class__
.
__name__
),
str
(
e
)))
...
...
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