Skip to content
Snippets Groups Projects
Commit 8213ee0e authored by Moul's avatar Moul
Browse files

[mod] #328: license: Import complete click module

parent f58280a9
No related branches found
No related tags found
No related merge requests found
......@@ -13,22 +13,21 @@
# You should have received a copy of the GNU Affero General Public License
# along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
import click
import webbrowser
from click import command, confirm, echo_via_pager
def license_approval(currency):
if currency != "g1":
return
if confirm(
if click.confirm(
"You will be asked to approve Ğ1 license. Would you like to display it?"
):
display_license()
confirm("Do you approve Ğ1 license?", abort=True)
click.confirm("Do you approve Ğ1 license?", abort=True)
@command("license", help="Display Ğ1 license")
@click.command("license", help="Display Ğ1 license")
def license_command():
display_license()
......@@ -37,7 +36,7 @@ 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/"):
echo_via_pager(open("licence-G1/license/license_g1-en.rst").read())
click.echo_via_pager(open("licence-G1/license/license_g1-en.rst").read())
else:
if not webbrowser.open("https://duniter.org/fr/wiki/licence-g1/"):
echo_via_pager(open("licence-G1/license/license_g1-fr-FR.rst").read())
click.echo_via_pager(open("licence-G1/license/license_g1-fr-FR.rst").read())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment