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
663e9587
Commit
663e9587
authored
7 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Clean code
parent
6f6e7880
No related branches found
No related tags found
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/data/graphs/base_graph.py
+0
-28
0 additions, 28 deletions
src/sakia/data/graphs/base_graph.py
src/sakia/data/graphs/wot_graph.py
+4
-2
4 additions, 2 deletions
src/sakia/data/graphs/wot_graph.py
with
4 additions
and
30 deletions
src/sakia/data/graphs/base_graph.py
+
0
−
28
View file @
663e9587
...
@@ -139,34 +139,6 @@ class BaseGraph(QObject):
...
@@ -139,34 +139,6 @@ class BaseGraph(QObject):
self
.
nx_graph
.
add_edge
(
identity
.
pubkey
,
certified
.
pubkey
,
attr_dict
=
arc
)
self
.
nx_graph
.
add_edge
(
identity
.
pubkey
,
certified
.
pubkey
,
attr_dict
=
arc
)
def
add_offline_certifier_list
(
self
,
certifier_list
,
identity
):
"""
Add list of certifiers to graph
:param List[sakia.data.entities.Certification] certifier_list: List of certified from api
:param sakia.data.entities.Identity identity: identity instance which is certified
:return:
"""
# add certifiers of uid
for
certification
in
tuple
(
certifier_list
):
certifier
=
self
.
identities_service
.
get_identity
(
certification
.
certifier
)
if
certifier
:
node_status
=
self
.
node_status
(
certifier
)
self
.
add_certifier_node
(
certifier
,
identity
,
certification
,
node_status
)
def
add_offline_certified_list
(
self
,
certified_list
,
identity
):
"""
Add list of certified from api to graph
:param List[sakia.data.entities.Certification] certified_list: List of certified from api
:param identity identity: identity instance which is certifier
:return:
"""
# add certified by uid
for
certification
in
tuple
(
certified_list
):
certified
=
self
.
identities_service
.
get_identity
(
certification
.
certified
)
if
certified
:
node_status
=
self
.
node_status
(
certified
)
self
.
add_certified_node
(
identity
,
certified
,
certification
,
node_status
)
def
add_certifier_list
(
self
,
certifier_list
,
identity
):
def
add_certifier_list
(
self
,
certifier_list
,
identity
):
"""
"""
Add list of certifiers to graph
Add list of certifiers to graph
...
...
This diff is collapsed.
Click to expand it.
src/sakia/data/graphs/wot_graph.py
+
4
−
2
View file @
663e9587
...
@@ -44,7 +44,9 @@ class WoTGraph(BaseGraph):
...
@@ -44,7 +44,9 @@ class WoTGraph(BaseGraph):
# populate graph with certifiers-of
# populate graph with certifiers-of
certifier_list
=
self
.
identities_service
.
certifications_received
(
center_identity
.
pubkey
)
certifier_list
=
self
.
identities_service
.
certifications_received
(
center_identity
.
pubkey
)
self
.
add_offline_certifier_list
(
certifier_list
,
center_identity
)
certifier_list
=
{
c
:
self
.
identities_service
.
get_identity
(
c
.
certifier
)
for
c
in
certifier_list
}
self
.
add_certifier_list
(
certifier_list
,
center_identity
)
# populate graph with certified-by
# populate graph with certified-by
certified_list
=
self
.
identities_service
.
certifications_sent
(
center_identity
.
pubkey
)
certified_list
=
self
.
identities_service
.
certifications_sent
(
center_identity
.
pubkey
)
self
.
add_offline_certified_list
(
certified_list
,
center_identity
)
certified_list
=
{
c
:
self
.
identities_service
.
get_identity
(
c
.
certified
)
for
c
in
certified_list
}
self
.
add_certified_list
(
certified_list
,
center_identity
)
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