From 7fc5977219acddb23971bb7ee30e68f56e60e165 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Fri, 14 Oct 2022 18:37:14 +0200 Subject: [PATCH] Move about cmd and about module (#330) --- silkaj/about.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ silkaj/cli.py | 30 ++---------------------------- 2 files changed, 48 insertions(+), 28 deletions(-) create mode 100644 silkaj/about.py diff --git a/silkaj/about.py b/silkaj/about.py new file mode 100644 index 00000000..55efeaaf --- /dev/null +++ b/silkaj/about.py @@ -0,0 +1,46 @@ +# Copyright 2016-2022 Maël Azimi <m.a@moul.re> +# +# Silkaj is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Silkaj is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# 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 + +from silkaj.constants import SILKAJ_VERSION + + +@click.command("about", help="Display program information") +def about() -> None: + print( + "\ +\n @@@@@@@@@@@@@\ +\n @@@ @ @@@\ +\n @@@ @@ @@@@@@ @@. Silkaj", + SILKAJ_VERSION, + "\ +\n @@ @@@ @@@@@@@@@@@ @@,\ +\n @@ @@@ &@@@@@@@@@@@@@ @@@ Powerfull and lightweight command line client\ +\n @@ @@@ @@@@@@@@@# @@@@ @@(\ +\n @@ @@@@ @@@@@@@@@ @@@ @@ Built in Python for Duniter’s currencies: \ +Ğ1 and Ğ1-Test\ +\n @@ @@@ @@@@@@@@ @ @@@ @@\ +\n @@ @@@ @@@@@@ @@@@ @@ @@ Authors: see AUTHORS.md file\ +\n @@ @@@@ @@@ @@@@@@@ @@ @@\ +\n @@ @@@@* @@@@@@@@@ @# @@ Website: https://silkaj.duniter.org\ +\n @@ @@@@@ @@@@@@@@@@ @ ,@@\ +\n @@ @@@@@ @@@@@@@@@@ @ ,@@ Repository: \ +https://git.duniter.org/clients/python/silkaj\ +\n @@@ @@@@@@@@@@@@ @ @@*\ +\n @@@ @@@@@@@@ @ @@@ License: GNU AGPLv3\ +\n @@@@ @@ @@@,\ +\n @@@@@@@@@@@@@@@\n", + ) diff --git a/silkaj/cli.py b/silkaj/cli.py index 1e72c20b..89b80402 100644 --- a/silkaj/cli.py +++ b/silkaj/cli.py @@ -19,6 +19,7 @@ from click import Context, group, help_option, option, pass_context, version_opt from duniterpy.api.endpoint import endpoint as du_endpoint from silkaj import revocation +from silkaj.about import about from silkaj.auth import generate_auth_file from silkaj.blockchain.blocks import list_blocks from silkaj.blockchain.difficulty import difficulties @@ -123,6 +124,7 @@ def cli( ctx.obj["DRY_RUN"] = dry_run +cli.add_command(about) cli.add_command(argos_info) cli.add_command(generate_auth_file) cli.add_command(cmd_amount) @@ -154,31 +156,3 @@ revocation_group.add_command(revocation.save) revocation_group.add_command(revocation.verify) revocation_group.add_command(revocation.publish) revocation_group.add_command(revocation.revoke_now) - - -@cli.command("about", help="Display program information") -def about() -> None: - print( - "\ -\n @@@@@@@@@@@@@\ -\n @@@ @ @@@\ -\n @@@ @@ @@@@@@ @@. Silkaj", - SILKAJ_VERSION, - "\ -\n @@ @@@ @@@@@@@@@@@ @@,\ -\n @@ @@@ &@@@@@@@@@@@@@ @@@ Powerfull and lightweight command line client\ -\n @@ @@@ @@@@@@@@@# @@@@ @@(\ -\n @@ @@@@ @@@@@@@@@ @@@ @@ Built in Python for Duniter’s currencies: \ -Ğ1 and Ğ1-Test\ -\n @@ @@@ @@@@@@@@ @ @@@ @@\ -\n @@ @@@ @@@@@@ @@@@ @@ @@ Authors: see AUTHORS.md file\ -\n @@ @@@@ @@@ @@@@@@@ @@ @@\ -\n @@ @@@@* @@@@@@@@@ @# @@ Website: https://silkaj.duniter.org\ -\n @@ @@@@@ @@@@@@@@@@ @ ,@@\ -\n @@ @@@@@ @@@@@@@@@@ @ ,@@ Repository: \ -https://git.duniter.org/clients/python/silkaj\ -\n @@@ @@@@@@@@@@@@ @ @@*\ -\n @@@ @@@@@@@@ @ @@@ License: GNU AGPLv3\ -\n @@@@ @@ @@@,\ -\n @@@@@@@@@@@@@@@\n", - ) -- GitLab