Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
4a8b67fb
Commit
4a8b67fb
authored
2 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mypy]
#163
: Add type annotation on idty_tools
parent
e2e26a38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!214
#163: Introduce mypy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
silkaj/idty_tools.py
+6
-6
6 additions, 6 deletions
silkaj/idty_tools.py
with
6 additions
and
6 deletions
silkaj/idty_tools.py
+
6
−
6
View file @
4a8b67fb
...
...
@@ -16,7 +16,7 @@
import
shutil
import
sys
import
urllib
from
typing
import
Union
from
typing
import
List
,
Union
import
click
import
pendulum
...
...
@@ -30,7 +30,7 @@ from silkaj.network_tools import client_instance
from
silkaj.tui
import
gen_pubkey_checksum
def
display_identity
(
idty
:
Identity
):
def
display_identity
(
idty
:
Identity
)
->
Texttable
:
"""
Creates a table containing the identity infos
"""
...
...
@@ -50,7 +50,7 @@ def display_identity(idty: Identity):
return
table
def
check_many_identities
(
document
:
Union
[
Identity
,
Revocation
]):
def
check_many_identities
(
document
:
Union
[
Identity
,
Revocation
])
->
bool
:
"""
Checks if many identities match the one looked after.
Returns True if the same identity is found, False if not.
...
...
@@ -86,7 +86,7 @@ def check_many_identities(document: Union[Identity, Revocation]):
return
False
def
display_alternate_ids
(
ids_list
:
l
ist
):
def
display_alternate_ids
(
ids_list
:
L
ist
)
->
Texttable
:
labels
=
[
"
uid
"
,
"
public key
"
,
"
timestamp
"
]
table
=
Texttable
(
max_width
=
shutil
.
get_terminal_size
().
columns
)
table
.
header
(
labels
)
...
...
@@ -95,7 +95,7 @@ def display_alternate_ids(ids_list: list):
return
table
def
merge_ids_lists
(
lookups_pubkey
:
l
ist
,
lookups_uid
:
l
ist
,
currency
:
str
):
def
merge_ids_lists
(
lookups_pubkey
:
L
ist
,
lookups_uid
:
L
ist
,
currency
:
str
)
->
List
:
"""
merge two lists of identities and remove duplicate identities.
"""
...
...
@@ -113,7 +113,7 @@ def merge_ids_lists(lookups_pubkey: list, lookups_uid: list, currency: str):
return
ids
def
ids_list_from_lookups
(
lookups
:
l
ist
,
currency
:
str
):
def
ids_list_from_lookups
(
lookups
:
L
ist
,
currency
:
str
)
->
List
:
ids
=
list
()
for
lookup
in
lookups
:
pubkey
=
lookup
[
"
pubkey
"
]
...
...
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