Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
15f5178f
Commit
15f5178f
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash
#357
parent
b86bc2ce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/core/net/node.py
+10
-9
10 additions, 9 deletions
src/sakia/core/net/node.py
src/sakia/gui/process_cfg_community.py
+6
-5
6 additions, 5 deletions
src/sakia/gui/process_cfg_community.py
with
16 additions
and
14 deletions
src/sakia/core/net/node.py
+
10
−
9
View file @
15f5178f
...
@@ -5,15 +5,13 @@ Created on 21 févr. 2015
...
@@ -5,15 +5,13 @@ Created on 21 févr. 2015
"""
"""
from
ucoinpy.documents.peer
import
Peer
,
Endpoint
,
BMAEndpoint
from
ucoinpy.documents.peer
import
Peer
,
Endpoint
,
BMAEndpoint
from
ucoinpy.documents
import
Block
,
BlockId
from
ucoinpy.documents
import
Block
,
BlockId
,
MalformedDocumentError
from
...tools.exceptions
import
InvalidNodeCurrency
from
...tools.exceptions
import
InvalidNodeCurrency
from
...tools.decorators
import
asyncify
from
...tools.decorators
import
asyncify
from
ucoinpy.api
import
bma
as
bma
from
ucoinpy.api
import
bma
as
bma
from
ucoinpy.api.bma
import
ConnectionHandler
from
ucoinpy.api.bma
import
ConnectionHandler
import
json
from
aiohttp.errors
import
WSClientDisconnectedError
,
WSServerHandshakeError
,
ClientResponseError
from
aiohttp.errors
import
ClientError
,
DisconnectedError
,
TimeoutError
,
\
WSClientDisconnectedError
,
WSServerHandshakeError
,
ClientResponseError
from
aiohttp.errors
import
ClientError
,
DisconnectedError
from
aiohttp.errors
import
ClientError
,
DisconnectedError
from
asyncio
import
TimeoutError
from
asyncio
import
TimeoutError
import
logging
import
logging
...
@@ -588,11 +586,14 @@ class Node(QObject):
...
@@ -588,11 +586,14 @@ class Node(QObject):
def
refresh_peer_data
(
self
,
peer_data
):
def
refresh_peer_data
(
self
,
peer_data
):
if
"
raw
"
in
peer_data
:
if
"
raw
"
in
peer_data
:
try
:
str_doc
=
"
{0}{1}
\n
"
.
format
(
peer_data
[
'
raw
'
],
str_doc
=
"
{0}{1}
\n
"
.
format
(
peer_data
[
'
raw
'
],
peer_data
[
'
signature
'
])
peer_data
[
'
signature
'
])
peer_doc
=
Peer
.
from_signed_raw
(
str_doc
)
peer_doc
=
Peer
.
from_signed_raw
(
str_doc
)
pubkey
=
peer_data
[
'
pubkey
'
]
pubkey
=
peer_data
[
'
pubkey
'
]
self
.
neighbour_found
.
emit
(
peer_doc
,
pubkey
)
self
.
neighbour_found
.
emit
(
peer_doc
,
pubkey
)
except
MalformedDocumentError
as
e
:
logging
.
debug
(
str
(
e
))
else
:
else
:
logging
.
debug
(
"
Incorrect leaf reply
"
)
logging
.
debug
(
"
Incorrect leaf reply
"
)
...
...
This diff is collapsed.
Click to expand it.
src/sakia/gui/process_cfg_community.py
+
6
−
5
View file @
15f5178f
...
@@ -8,9 +8,10 @@ import logging
...
@@ -8,9 +8,10 @@ import logging
import
asyncio
import
asyncio
import
aiohttp
import
aiohttp
from
PyQt5.QtWidgets
import
QDialog
,
QMenu
,
QMessageBox
,
QApplication
from
ucoinpy.documents
import
MalformedDocumentError
from
PyQt5.QtWidgets
import
QDialog
,
QMenu
,
QApplication
from
PyQt5.QtGui
import
QCursor
from
PyQt5.QtGui
import
QCursor
from
PyQt5.QtCore
import
pyqtSlot
,
pyqtSignal
,
QObject
from
PyQt5.QtCore
import
pyqtSignal
,
QObject
from
..gen_resources.community_cfg_uic
import
Ui_CommunityConfigurationDialog
from
..gen_resources.community_cfg_uic
import
Ui_CommunityConfigurationDialog
from
..models.peering
import
PeeringTreeModel
from
..models.peering
import
PeeringTreeModel
...
@@ -73,7 +74,7 @@ class StepPageInit(Step):
...
@@ -73,7 +74,7 @@ class StepPageInit(Step):
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
except
aiohttp
.
errors
.
ClientError
as
e
:
except
aiohttp
.
errors
.
ClientError
as
e
:
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
except
ValueError
as
e
:
except
(
MalformedDocumentError
,
ValueError
)
as
e
:
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
@asyncify
@asyncify
...
@@ -101,7 +102,7 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2])))
...
@@ -101,7 +102,7 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2])))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
except
aiohttp
.
errors
.
ClientError
as
e
:
except
aiohttp
.
errors
.
ClientError
as
e
:
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
except
ValueError
as
e
:
except
(
MalformedDocumentError
,
ValueError
)
as
e
:
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
@asyncify
@asyncify
...
@@ -144,7 +145,7 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2])))
...
@@ -144,7 +145,7 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2])))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
except
aiohttp
.
errors
.
ClientError
as
e
:
except
aiohttp
.
errors
.
ClientError
as
e
:
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
except
ValueError
as
e
:
except
(
MalformedDocumentError
,
ValueError
)
as
e
:
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
self
.
config_dialog
.
label_error
.
setText
(
str
(
e
))
def
is_valid
(
self
):
def
is_valid
(
self
):
...
...
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