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
fa4f6cb0
Commit
fa4f6cb0
authored
10 years ago
by
inso
Browse files
Options
Downloads
Plain Diff
Merge branch 'wot' into dev
parents
9f2523ca
c615fc1e
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
src/cutecoin/gui/views/wot.py
+11
-11
11 additions, 11 deletions
src/cutecoin/gui/views/wot.py
src/cutecoin/gui/wot_tab.py
+10
-13
10 additions, 13 deletions
src/cutecoin/gui/wot_tab.py
with
21 additions
and
24 deletions
src/cutecoin/gui/views/wot.py
+
11
−
11
View file @
fa4f6cb0
...
@@ -124,15 +124,15 @@ class Scene(QGraphicsScene):
...
@@ -124,15 +124,15 @@ class Scene(QGraphicsScene):
y
=
0
y
=
0
x
=
200
x
=
200
# capture nodes for sorting by text
# capture nodes for sorting by text
nodes
=
dic
t
()
nodes
=
lis
t
()
for
arc
in
selected_node
[
'
arcs
'
]:
for
arc
in
selected_node
[
'
arcs
'
]:
nodes
[
arc
[
'
id
'
]]
=
{
'
node
'
:
graph
[
arc
[
'
id
'
]],
'
arc
'
:
arc
}
nodes
.
append
(
{
'
node
'
:
graph
[
arc
[
'
id
'
]],
'
arc
'
:
arc
}
)
# sort by text
# sort by text
nodes
=
((
k
,
v
)
for
(
k
,
v
)
in
sorted
(
nodes
.
items
()
,
key
=
lambda
kv
:
kv
[
1
]
[
'
node
'
][
'
text
'
].
lower
())
)
nodes
=
sorted
(
nodes
,
key
=
lambda
_node
:
_node
[
'
node
'
][
'
text
'
].
lower
())
# add nodes and arcs
# add nodes and arcs
for
_
id
,
items
in
nodes
:
for
_
node
in
nodes
:
node
=
self
.
add_node
(
items
[
'
node
'
],
(
x
,
y
))
node
=
self
.
add_node
(
_node
[
'
node
'
],
(
x
,
y
))
self
.
add_arc
(
root_node
,
node
,
items
[
'
arc
'
])
self
.
add_arc
(
root_node
,
node
,
_node
[
'
arc
'
])
y
+=
50
y
+=
50
# add certifiers of selected node
# add certifiers of selected node
...
@@ -142,9 +142,9 @@ class Scene(QGraphicsScene):
...
@@ -142,9 +142,9 @@ class Scene(QGraphicsScene):
nodes
=
((
k
,
v
)
for
(
k
,
v
)
in
sorted
(
graph
.
items
(),
key
=
lambda
kv
:
kv
[
1
][
'
text
'
].
lower
())
if
selected_id
in
(
arc
[
'
id
'
]
for
arc
in
v
[
'
arcs
'
]))
nodes
=
((
k
,
v
)
for
(
k
,
v
)
in
sorted
(
graph
.
items
(),
key
=
lambda
kv
:
kv
[
1
][
'
text
'
].
lower
())
if
selected_id
in
(
arc
[
'
id
'
]
for
arc
in
v
[
'
arcs
'
]))
# add nodes and arcs
# add nodes and arcs
for
_id
,
certifier_node
in
nodes
:
for
_id
,
certifier_node
in
nodes
:
node
=
self
.
add_node
(
certifier_node
,
(
x
,
y
))
for
arc
in
certifier_node
[
'
arcs
'
]:
for
arc
in
certifier_node
[
'
arcs
'
]:
if
arc
[
'
id
'
]
==
selected_id
:
if
arc
[
'
id
'
]
==
selected_id
:
node
=
self
.
add_node
(
certifier_node
,
(
x
,
y
))
self
.
add_arc
(
node
,
root_node
,
arc
)
self
.
add_arc
(
node
,
root_node
,
arc
)
y
+=
50
y
+=
50
...
@@ -239,15 +239,15 @@ class Node(QGraphicsEllipseItem):
...
@@ -239,15 +239,15 @@ class Node(QGraphicsEllipseItem):
# create node context menus
# create node context menus
self
.
menu
=
QMenu
()
self
.
menu
=
QMenu
()
# action sign identity
# action sign identity
self
.
action_sign
=
QAction
(
'
Sign
identity
'
,
self
.
scene
())
self
.
action_sign
=
QAction
(
'
Certify
identity
'
,
self
.
scene
())
self
.
menu
.
addAction
(
self
.
action_sign
)
self
.
menu
.
addAction
(
self
.
action_sign
)
self
.
action_sign
.
triggered
.
connect
(
self
.
sign_action
)
self
.
action_sign
.
triggered
.
connect
(
self
.
sign_action
)
# action transaction toward identity
# action transaction toward identity
self
.
action_transaction
=
QAction
(
'
Send money
to identity
'
,
self
.
scene
())
self
.
action_transaction
=
QAction
(
'
Send money
'
,
self
.
scene
())
self
.
menu
.
addAction
(
self
.
action_transaction
)
self
.
menu
.
addAction
(
self
.
action_transaction
)
self
.
action_transaction
.
triggered
.
connect
(
self
.
transaction_action
)
self
.
action_transaction
.
triggered
.
connect
(
self
.
transaction_action
)
# action add identity as contact
# action add identity as contact
self
.
action_contact
=
QAction
(
'
Add
identity
as contact
'
,
self
.
scene
())
self
.
action_contact
=
QAction
(
'
Add as contact
'
,
self
.
scene
())
self
.
menu
.
addAction
(
self
.
action_contact
)
self
.
menu
.
addAction
(
self
.
action_contact
)
self
.
action_contact
.
triggered
.
connect
(
self
.
contact_action
)
self
.
action_contact
.
triggered
.
connect
(
self
.
contact_action
)
# run menu
# run menu
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/wot_tab.py
+
10
−
13
View file @
fa4f6cb0
...
@@ -71,6 +71,15 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
...
@@ -71,6 +71,15 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
# add certifiers of uid
# add certifiers of uid
for
certifier
in
certifiers
[
'
certifications
'
]:
for
certifier
in
certifiers
[
'
certifications
'
]:
if
certifier
[
'
pubkey
'
]
not
in
graph
.
keys
():
node_status
=
(
NODE_STATUS_HIGHLIGHTED
and
(
certifier
[
'
pubkey
'
]
==
self
.
account
.
pubkey
))
or
0
graph
[
certifier
[
'
pubkey
'
]]
=
{
'
id
'
:
certifier
[
'
pubkey
'
],
'
arcs
'
:
list
(),
'
text
'
:
certifier
[
'
uid
'
],
'
tooltip
'
:
certifier
[
'
pubkey
'
],
'
status
'
:
node_status
}
if
(
time
.
time
()
-
certifier
[
'
cert_time
'
][
'
medianTime
'
])
>
self
.
ARC_STATUS_STRONG_time
:
if
(
time
.
time
()
-
certifier
[
'
cert_time
'
][
'
medianTime
'
])
>
self
.
ARC_STATUS_STRONG_time
:
arc_status
=
ARC_STATUS_WEAK
arc_status
=
ARC_STATUS_WEAK
else
:
else
:
...
@@ -82,15 +91,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
...
@@ -82,15 +91,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
certifier
[
'
cert_time
'
][
'
medianTime
'
]
+
self
.
signature_validity
certifier
[
'
cert_time
'
][
'
medianTime
'
]
+
self
.
signature_validity
).
strftime
(
"
%Y/%m/%d
"
)
).
strftime
(
"
%Y/%m/%d
"
)
}
}
if
certifier
[
'
pubkey
'
]
not
in
graph
.
keys
():
graph
[
certifier
[
'
pubkey
'
]][
'
arcs
'
].
append
(
arc
)
node_status
=
(
NODE_STATUS_HIGHLIGHTED
and
(
certifier
[
'
pubkey
'
]
==
self
.
account
.
pubkey
))
or
0
graph
[
certifier
[
'
pubkey
'
]]
=
{
'
id
'
:
certifier
[
'
pubkey
'
],
'
arcs
'
:
[
arc
],
'
text
'
:
certifier
[
'
uid
'
],
'
tooltip
'
:
certifier
[
'
pubkey
'
],
'
status
'
:
node_status
}
# add certified by uid
# add certified by uid
for
certified
in
self
.
community
.
request
(
bma
.
wot
.
CertifiedBy
,
{
'
search
'
:
public_key
})[
'
certifications
'
]:
for
certified
in
self
.
community
.
request
(
bma
.
wot
.
CertifiedBy
,
{
'
search
'
:
public_key
})[
'
certifications
'
]:
...
@@ -167,10 +168,6 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
...
@@ -167,10 +168,6 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
)
)
def
sign_node
(
self
,
metadata
):
def
sign_node
(
self
,
metadata
):
# check if identity already certified...
for
certified
in
self
.
community
.
request
(
bma
.
wot
.
CertifiedBy
,
{
'
search
'
:
self
.
account
.
pubkey
})[
'
certifications
'
]:
if
metadata
[
'
id
'
]
==
certified
[
'
pubkey
'
]:
return
False
# open certify dialog
# open certify dialog
dialog
=
CertificationDialog
(
self
.
account
)
dialog
=
CertificationDialog
(
self
.
account
)
dialog
.
edit_pubkey
.
setText
(
metadata
[
'
id
'
])
dialog
.
edit_pubkey
.
setText
(
metadata
[
'
id
'
])
...
...
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