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
61d86c38
Commit
61d86c38
authored
10 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Display path to account in member window
parent
96db7af6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cutecoin/core/graph.py
+20
-3
20 additions, 3 deletions
src/cutecoin/core/graph.py
src/cutecoin/gui/views/wot.py
+1
-1
1 addition, 1 deletion
src/cutecoin/gui/views/wot.py
src/cutecoin/gui/wot_tab.py
+1
-1
1 addition, 1 deletion
src/cutecoin/gui/wot_tab.py
with
22 additions
and
5 deletions
src/cutecoin/core/graph.py
+
20
−
3
View file @
61d86c38
...
@@ -9,15 +9,27 @@ from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_OUT, ARC
...
@@ -9,15 +9,27 @@ from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_OUT, ARC
class
Graph
(
dict
):
class
Graph
(
dict
):
def
__init__
(
self
,
community
):
def
__init__
(
self
,
community
):
"""
Init Graph instance
:param cutecoin.core.community.Community community:
:return:
"""
self
.
community
=
community
self
.
community
=
community
self
.
signature_validity
=
self
.
community
.
get_parameters
()[
'
sigValidity
'
]
self
.
signature_validity
=
self
.
community
.
get_parameters
()[
'
sigValidity
'
]
# arc considered strong during 75% of signature validity time
# arc considered strong during 75% of signature validity time
self
.
ARC_STATUS_STRONG_time
=
int
(
self
.
signature_validity
*
0.75
)
self
.
ARC_STATUS_STRONG_time
=
int
(
self
.
signature_validity
*
0.75
)
def
get_shortest_path_between_members
(
self
,
from_person
,
to_person
):
def
get_shortest_path_between_members
(
self
,
from_person
,
to_person
):
"""
Return path list of nodes from from_person to to_person
:param Person from_person:
:param Person to_person:
:return:
"""
path
=
list
()
path
=
list
()
graph_tmp
=
copy
.
deepcopy
(
self
)
graph_tmp
=
copy
.
deepcopy
(
self
)
logging
.
debug
(
"
path between %s to %s...
"
%
(
from_person
.
name
,
to_person
.
name
))
if
from_person
.
pubkey
not
in
graph_tmp
.
keys
():
if
from_person
.
pubkey
not
in
graph_tmp
.
keys
():
graph_tmp
.
add_person
(
from_person
)
graph_tmp
.
add_person
(
from_person
)
certifier_list
=
from_person
.
certifiers_of
(
self
.
community
)
certifier_list
=
from_person
.
certifiers_of
(
self
.
community
)
...
@@ -39,7 +51,12 @@ class Graph(dict):
...
@@ -39,7 +51,12 @@ class Graph(dict):
return
path
return
path
def
explore_to_find_member
(
self
,
person
,
nodes
=
list
(),
done
=
list
()):
def
explore_to_find_member
(
self
,
person
,
nodes
=
None
,
done
=
None
):
# functions keywords args are persistent... Need to reset it with None trick
nodes
=
nodes
or
(
list
()
and
(
nodes
is
None
))
done
=
done
or
(
list
()
and
(
done
is
None
))
logging
.
debug
(
"
search %s in
"
%
person
.
name
)
logging
.
debug
([
node
[
'
text
'
]
for
node
in
nodes
])
for
node
in
tuple
(
nodes
):
for
node
in
tuple
(
nodes
):
if
node
[
'
id
'
]
in
tuple
(
done
):
if
node
[
'
id
'
]
in
tuple
(
done
):
continue
continue
...
@@ -180,8 +197,8 @@ class Graph(dict):
...
@@ -180,8 +197,8 @@ class Graph(dict):
def
add_person
(
self
,
person
,
status
=
0
,
arcs
=
None
,
nodes
=
None
):
def
add_person
(
self
,
person
,
status
=
0
,
arcs
=
None
,
nodes
=
None
):
# functions keywords args are persistent... Need to reset it with None trick
# functions keywords args are persistent... Need to reset it with None trick
arcs
=
list
()
and
(
arcs
is
None
)
arcs
=
arcs
or
(
list
()
and
(
arcs
is
None
)
)
nodes
=
list
()
and
(
nodes
is
None
)
nodes
=
nodes
or
(
list
()
and
(
nodes
is
None
)
)
self
[
person
.
pubkey
]
=
{
self
[
person
.
pubkey
]
=
{
'
id
'
:
person
.
pubkey
,
'
id
'
:
person
.
pubkey
,
'
arcs
'
:
arcs
,
'
arcs
'
:
arcs
,
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/views/wot.py
+
1
−
1
View file @
61d86c38
...
@@ -282,7 +282,7 @@ class Node(QGraphicsEllipseItem):
...
@@ -282,7 +282,7 @@ class Node(QGraphicsEllipseItem):
# create node context menus
# create node context menus
self
.
menu
=
QMenu
()
self
.
menu
=
QMenu
()
# action show member
# action show member
self
.
action_show_member
=
QAction
(
'
Show member
'
,
self
.
scene
())
self
.
action_show_member
=
QAction
(
'
Informations
'
,
self
.
scene
())
self
.
menu
.
addAction
(
self
.
action_show_member
)
self
.
menu
.
addAction
(
self
.
action_show_member
)
self
.
action_show_member
.
triggered
.
connect
(
self
.
member_action
)
self
.
action_show_member
.
triggered
.
connect
(
self
.
member_action
)
# action add identity as contact
# action add identity as contact
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/wot_tab.py
+
1
−
1
View file @
61d86c38
...
@@ -58,7 +58,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
...
@@ -58,7 +58,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
:param dict metadata: Graph node metadata of the identity
:param dict metadata: Graph node metadata of the identity
"""
"""
logging
.
debug
(
"
d
raw graph
!!!!!!!!!!!!
-
"
+
metadata
[
'
text
'
])
logging
.
debug
(
"
D
raw graph -
"
+
metadata
[
'
text
'
])
# create Person from node metadata
# create Person from node metadata
person
=
get_person_from_metadata
(
metadata
)
person
=
get_person_from_metadata
(
metadata
)
...
...
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