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
c0306582
Commit
c0306582
authored
6 years ago
by
Moul
Browse files
Options
Downloads
Plain Diff
Merge branch '95_license_cmd' into dev
parents
02dfb9e1
077f5c3e
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/cert.py
+1
-19
1 addition, 19 deletions
src/cert.py
src/license.py
+21
-0
21 additions, 0 deletions
src/license.py
src/silkaj.py
+8
-2
8 additions, 2 deletions
src/silkaj.py
with
30 additions
and
21 deletions
src/cert.py
+
1
−
19
View file @
c0306582
import
webbrowser
import
urllib
import
urllib
from
sys
import
exit
from
pydoc
import
pager
from
tabulate
import
tabulate
from
tabulate
import
tabulate
from
auth
import
auth_method
from
auth
import
auth_method
from
tools
import
get_publickey_from_seed
,
message_exit
,
sign_document_from_seed
from
tools
import
get_publickey_from_seed
,
message_exit
,
sign_document_from_seed
from
network_tools
import
get_current_block
,
post_request
from
network_tools
import
get_current_block
,
post_request
from
license
import
license_approval
from
constants
import
NO_MATCHING_ID
from
constants
import
NO_MATCHING_ID
from
wot
import
is_member
,
get_pubkey_from_id
,
get_pubkeys_from_id
,
\
from
wot
import
is_member
,
get_pubkey_from_id
,
get_pubkeys_from_id
,
\
get_uid_from_pubkey
get_uid_from_pubkey
...
@@ -55,21 +52,6 @@ def send_certification(ep, cli_args):
...
@@ -55,21 +52,6 @@ def send_certification(ep, cli_args):
print
(
"
Certification successfully sent.
"
)
print
(
"
Certification successfully sent.
"
)
def
license_approval
(
currency
):
if
currency
!=
"
g1
"
:
return
language
=
input
(
"
In which language would you like to display Ğ1 license [en/fr]?
"
)
if
(
language
==
"
en
"
):
if
not
webbrowser
.
open
(
"
https://duniter.org/en/get-g1/
"
):
pager
(
open
(
"
licence-G1/license/license_g1-en.rst
"
).
read
())
else
:
if
not
webbrowser
.
open
(
"
https://duniter.org/fr/wiki/licence-g1/
"
):
pager
(
open
(
"
licence-G1/license/license_g1-fr-FR.rst
"
).
read
())
if
(
input
(
"
Do you approve Ğ1 license [yes/no]?
"
)
!=
"
yes
"
):
exit
(
1
)
def
certification_confirmation
(
issuer_id
,
issuer_pubkey
,
certified_uid
,
certified_pubkey
):
def
certification_confirmation
(
issuer_id
,
issuer_pubkey
,
certified_uid
,
certified_pubkey
):
cert
=
list
()
cert
=
list
()
cert
.
append
([
"
Cert
"
,
"
From
"
,
"
–>
"
,
"
To
"
])
cert
.
append
([
"
Cert
"
,
"
From
"
,
"
–>
"
,
"
To
"
])
...
...
This diff is collapsed.
Click to expand it.
src/license.py
0 → 100644
+
21
−
0
View file @
c0306582
import
webbrowser
from
pydoc
import
pager
from
sys
import
exit
def
license_approval
(
currency
):
if
currency
!=
"
g1
"
:
return
display_license
()
if
(
input
(
"
Do you approve Ğ1 license [yes/no]?
"
)
!=
"
yes
"
):
exit
(
1
)
def
display_license
():
language
=
input
(
"
In which language would you like to display Ğ1 license [en/fr]?
"
)
if
(
language
==
"
en
"
):
if
not
webbrowser
.
open
(
"
https://duniter.org/en/wiki/g1-license/
"
):
pager
(
open
(
"
licence-G1/license/license_g1-en.rst
"
).
read
())
else
:
if
not
webbrowser
.
open
(
"
https://duniter.org/fr/wiki/licence-g1/
"
):
pager
(
open
(
"
licence-G1/license/license_g1-fr-FR.rst
"
).
read
())
This diff is collapsed.
Click to expand it.
src/silkaj.py
+
8
−
2
View file @
c0306582
...
@@ -12,6 +12,7 @@ from tools import message_exit
...
@@ -12,6 +12,7 @@ from tools import message_exit
from
network_tools
import
check_port
,
best_node
from
network_tools
import
check_port
,
best_node
from
wot
import
received_sent_certifications
,
id_pubkey_correspondence
from
wot
import
received_sent_certifications
,
id_pubkey_correspondence
from
auth
import
generate_auth_file
from
auth
import
generate_auth_file
from
license
import
display_license
from
constants
import
SILKAJ_VERSION
,
G1_SYMBOL
,
GTEST_SYMBOL
,
G1_DEFAULT_ENDPOINT
,
G1_TEST_DEFAULT_ENDPOINT
from
constants
import
SILKAJ_VERSION
,
G1_SYMBOL
,
GTEST_SYMBOL
,
G1_DEFAULT_ENDPOINT
,
G1_TEST_DEFAULT_ENDPOINT
...
@@ -67,7 +68,9 @@ def usage():
...
@@ -67,7 +68,9 @@ def usage():
\n
it could autocomplete the pubkey corresponding to an identity with three or four following characters.
\
\n
it could autocomplete the pubkey corresponding to an identity with three or four following characters.
\
\n
\
\n
\
\n
- wot <pubkey> or <identity>: display received and sent certifications for an account.
\
\n
- wot <pubkey> or <identity>: display received and sent certifications for an account.
\
\n\
\n
\
\n
- license: display Ğ1 currency license.
\
\n
\
\n
Authentication:
\
\n
Authentication:
\
\n
for amount, transaction, certification, and generate_auth_file commands
\
\n
for amount, transaction, certification, and generate_auth_file commands
\
\n
- Scrypt is the default authentication method with 4096,16,1 as default values
\
\n
- Scrypt is the default authentication method with 4096,16,1 as default values
\
...
@@ -80,7 +83,7 @@ def usage():
...
@@ -80,7 +83,7 @@ def usage():
def
cli
():
def
cli
():
# ep: endpoint, node's network interface
# ep: endpoint, node's network interface
ep
,
cli_args
=
dict
(),
Command
()
ep
,
cli_args
=
dict
(),
Command
()
subcmd
=
[
"
about
"
,
"
info
"
,
"
diffi
"
,
"
net
"
,
"
network
"
,
"
issuers
"
,
"
argos
"
,
"
amount
"
,
"
tx
"
,
"
transaction
"
,
"
cert
"
,
"
generate_auth_file
"
,
"
id
"
,
"
identities
"
,
"
wot
"
]
subcmd
=
[
"
license
"
,
"
about
"
,
"
info
"
,
"
diffi
"
,
"
net
"
,
"
network
"
,
"
issuers
"
,
"
argos
"
,
"
amount
"
,
"
tx
"
,
"
transaction
"
,
"
cert
"
,
"
generate_auth_file
"
,
"
id
"
,
"
identities
"
,
"
wot
"
]
if
cli_args
.
is_version_request
():
if
cli_args
.
is_version_request
():
message_exit
(
SILKAJ_VERSION
)
message_exit
(
SILKAJ_VERSION
)
if
cli_args
.
is_help_request
()
or
cli_args
.
is_usage_request
()
or
cli_args
.
subcmd
not
in
subcmd
:
if
cli_args
.
is_help_request
()
or
cli_args
.
is_usage_request
()
or
cli_args
.
subcmd
not
in
subcmd
:
...
@@ -136,6 +139,9 @@ def manage_cmd(ep, c):
...
@@ -136,6 +139,9 @@ def manage_cmd(ep, c):
elif
cli_args
.
subcmd
==
"
wot
"
:
elif
cli_args
.
subcmd
==
"
wot
"
:
received_sent_certifications
(
ep
,
cli_args
.
subsubcmd
)
received_sent_certifications
(
ep
,
cli_args
.
subsubcmd
)
elif
cli_args
.
subcmd
==
"
license
"
:
display_license
()
def
about
():
def
about
():
print
(
"
\
print
(
"
\
...
...
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