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
Snippets
Deploy
Releases
Container Registry
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
Show more breadcrumbs
Santiago
sakia
Commits
939c3d88
Commit
939c3d88
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Moved person_from_metadata to Person.from_metadata
parent
15f712ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cutecoin/core/person.py
+3
-1
3 additions, 1 deletion
src/cutecoin/core/person.py
src/cutecoin/gui/wot_tab.py
+5
-12
5 additions, 12 deletions
src/cutecoin/gui/wot_tab.py
with
8 additions
and
13 deletions
src/cutecoin/core/person.py
+
3
−
1
View file @
939c3d88
...
...
@@ -107,7 +107,9 @@ class Person(object):
raise
PersonNotFoundError
(
pubkey
,
community
.
name
())
@classmethod
def
from_metadata
(
cls
,
name
,
pubkey
):
def
from_metadata
(
cls
,
metadata
):
name
=
metadata
[
'
text
'
]
pubkey
=
metadata
[
'
id
'
]
if
pubkey
in
Person
.
_instances
:
return
Person
.
_instances
[
pubkey
]
else
:
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/wot_tab.py
+
5
−
12
View file @
939c3d88
...
...
@@ -9,10 +9,6 @@ from ucoinpy.api import bma
from
cutecoin.core.person
import
Person
def
get_person_from_metadata
(
metadata
):
return
Person
(
metadata
[
'
text
'
],
metadata
[
'
id
'
])
class
WotTabWidget
(
QWidget
,
Ui_WotTabWidget
):
def
__init__
(
self
,
account
,
community
,
password_asker
,
parent
=
None
):
"""
...
...
@@ -61,7 +57,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
logging
.
debug
(
"
Draw graph -
"
+
metadata
[
'
text
'
])
# create Person from node metadata
person
=
get_p
erson
_
from_metadata
(
metadata
)
person
=
P
erson
.
from_metadata
(
metadata
)
person_account
=
Person
(
self
.
account
.
name
,
self
.
account
.
pubkey
)
certifier_list
=
person
.
certifiers_of
(
self
.
community
)
certified_list
=
person
.
certified_by
(
self
.
community
)
...
...
@@ -142,22 +138,22 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
)
def
member_informations
(
self
,
metadata
):
person
=
get_p
erson
_
from_metadata
(
metadata
)
person
=
P
erson
.
from_metadata
(
metadata
)
self
.
parent
.
member_informations
(
person
)
def
sign_node
(
self
,
metadata
):
person
=
get_p
erson
_
from_metadata
(
metadata
)
person
=
P
erson
.
from_metadata
(
metadata
)
self
.
parent
.
certify_member
(
person
)
def
send_money_to_node
(
self
,
metadata
):
person
=
get_p
erson
_
from_metadata
(
metadata
)
person
=
P
erson
.
from_metadata
(
metadata
)
self
.
parent
.
send_money_to_member
(
person
)
def
add_node_as_contact
(
self
,
metadata
):
# check if contact already exists...
if
metadata
[
'
id
'
]
==
self
.
account
.
pubkey
or
metadata
[
'
id
'
]
in
[
contact
.
pubkey
for
contact
in
self
.
account
.
contacts
]:
return
False
person
=
get_p
erson
_
from_metadata
(
metadata
)
person
=
P
erson
.
from_metadata
(
metadata
)
self
.
parent
.
add_member_as_contact
(
person
)
def
get_block_mediantime
(
self
,
number
):
...
...
@@ -167,6 +163,3 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
logging
.
debug
(
'
community.get_block request error :
'
+
str
(
e
))
return
False
return
block
.
mediantime
def
get_person_from_metadata
(
self
,
metadata
):
return
Person
.
from_metadata
(
metadata
[
'
text
'
],
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