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
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
ac1d06f3
Commit
ac1d06f3
authored
10 years ago
by
inso
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/vtexier' into dev
parents
efd492e3
7016acf0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cutecoin/core/net/node.py
+6
-8
6 additions, 8 deletions
src/cutecoin/core/net/node.py
src/cutecoin/gui/currency_tab.py
+8
-0
8 additions, 0 deletions
src/cutecoin/gui/currency_tab.py
src/cutecoin/models/network.py
+7
-2
7 additions, 2 deletions
src/cutecoin/models/network.py
with
21 additions
and
10 deletions
src/cutecoin/core/net/node.py
+
6
−
8
View file @
ac1d06f3
...
@@ -34,13 +34,7 @@ class Node(QObject):
...
@@ -34,13 +34,7 @@ class Node(QObject):
def
__init__
(
self
,
currency
,
endpoints
,
pubkey
,
block
,
state
):
def
__init__
(
self
,
currency
,
endpoints
,
pubkey
,
block
,
state
):
'''
'''
Constructor of a node
Constructor
:param str currency: The currency name of this node community
:param list endpoints: Endpoints ucoinpy objects
:param str pubkey: The node pubkey
:param int block: The node last current block
:param state: The state of the node
'''
'''
super
().
__init__
()
super
().
__init__
()
self
.
_endpoints
=
endpoints
self
.
_endpoints
=
endpoints
...
@@ -117,7 +111,7 @@ class Node(QObject):
...
@@ -117,7 +111,7 @@ class Node(QObject):
return
self
.
_pubkey
return
self
.
_pubkey
@property
@property
def
endpoint
(
self
):
def
endpoint
(
self
)
->
BMAEndpoint
:
return
next
((
e
for
e
in
self
.
_endpoints
if
type
(
e
)
is
BMAEndpoint
))
return
next
((
e
for
e
in
self
.
_endpoints
if
type
(
e
)
is
BMAEndpoint
))
@property
@property
...
@@ -219,3 +213,7 @@ class Node(QObject):
...
@@ -219,3 +213,7 @@ class Node(QObject):
time
.
sleep
(
interval
)
time
.
sleep
(
interval
)
except
RequestException
as
e
:
except
RequestException
as
e
:
self
.
_state
=
Node
.
OFFLINE
self
.
_state
=
Node
.
OFFLINE
def
__str__
(
self
):
return
'
,
'
.
join
([
str
(
self
.
pubkey
),
str
(
self
.
endpoint
.
server
),
str
(
self
.
endpoint
.
port
),
str
(
self
.
block
),
str
(
self
.
currency
),
str
(
self
.
state
),
str
(
self
.
neighbours
)])
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/currency_tab.py
+
8
−
0
View file @
ac1d06f3
...
@@ -5,6 +5,7 @@ Created on 2 févr. 2014
...
@@ -5,6 +5,7 @@ Created on 2 févr. 2014
'''
'''
import
time
import
time
import
logging
from
PyQt5.QtWidgets
import
QWidget
,
QMenu
,
QAction
,
QApplication
,
\
from
PyQt5.QtWidgets
import
QWidget
,
QMenu
,
QAction
,
QApplication
,
\
QMessageBox
,
QDialog
,
QAbstractItemView
,
QHeaderView
QMessageBox
,
QDialog
,
QAbstractItemView
,
QHeaderView
from
PyQt5.QtCore
import
QModelIndex
,
Qt
,
pyqtSlot
,
\
from
PyQt5.QtCore
import
QModelIndex
,
Qt
,
pyqtSlot
,
\
...
@@ -145,6 +146,13 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
...
@@ -145,6 +146,13 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
QIcon
(
'
:/icons/informations_icon
'
),
QIcon
(
'
:/icons/informations_icon
'
),
"
Informations
"
)
"
Informations
"
)
# fix bug refresh_nodes launch on destroyed NetworkTabWidget
logging
.
debug
(
'
Disconnect community.network.nodes_changed
'
)
try
:
self
.
community
.
network
.
nodes_changed
.
disconnect
()
except
TypeError
:
logging
.
debug
(
'
No signals on community.network.nodes_changed
'
)
self
.
tab_network
=
NetworkTabWidget
(
self
.
community
)
self
.
tab_network
=
NetworkTabWidget
(
self
.
community
)
self
.
tabs_account
.
addTab
(
self
.
tab_network
,
self
.
tabs_account
.
addTab
(
self
.
tab_network
,
QIcon
(
"
:/icons/network_icon
"
),
QIcon
(
"
:/icons/network_icon
"
),
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/models/network.py
+
7
−
2
View file @
ac1d06f3
...
@@ -94,7 +94,12 @@ class NetworkTableModel(QAbstractTableModel):
...
@@ -94,7 +94,12 @@ class NetworkTableModel(QAbstractTableModel):
return
self
.
column_types
[
section
]
return
self
.
column_types
[
section
]
def
data_node
(
self
,
node
):
def
data_node
(
self
,
node
:
Node
)
->
tuple
:
"""
Return node data tuple
:param ..core.net.node.Node node: Network node
:return:
"""
try
:
try
:
person
=
Person
.
lookup
(
node
.
pubkey
,
self
.
community
)
person
=
Person
.
lookup
(
node
.
pubkey
,
self
.
community
)
uid
=
person
.
name
uid
=
person
.
name
...
@@ -112,7 +117,7 @@ class NetworkTableModel(QAbstractTableModel):
...
@@ -112,7 +117,7 @@ class NetworkTableModel(QAbstractTableModel):
address
=
node
.
endpoint
.
ipv6
address
=
node
.
endpoint
.
ipv6
port
=
node
.
endpoint
.
port
port
=
node
.
endpoint
.
port
return
(
node
.
pubkey
,
is_member
,
uid
,
address
,
port
,
node
.
block
)
return
node
.
pubkey
,
is_member
,
uid
,
address
,
port
,
node
.
block
def
data
(
self
,
index
,
role
):
def
data
(
self
,
index
,
role
):
row
=
index
.
row
()
row
=
index
.
row
()
...
...
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