Compare commits
5 Commits
f4de57a47b
...
17ebb60b2f
Author | SHA1 | Date |
---|---|---|
Jean-Jacques Brucker | 17ebb60b2f | |
Jean-Jacques Brucker | 001d17dd06 | |
Jean-Jacques Brucker | b7fa622941 | |
poka | fecc636418 | |
qo-op | 864334d06d |
|
@ -13,7 +13,7 @@ Débrouillez-vous.
|
|||
|
||||
## Utilisation
|
||||
|
||||
*Python 3.9 minimum*
|
||||
*Python 3.6 minimum*
|
||||
|
||||
Renseignez optionnellement le fichier **.env** (Généré lors de la première tentative d'execution, ou à copier depuis .env.template).
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: jaklis
|
||||
Upstream-Contact: <preferred name and address to reach the upstream project>
|
||||
Source: <url://example.com>
|
||||
Upstream-Contact: Etienne Bouché <poka@p2p.legal>
|
||||
Source: https://git.p2p.legal/axiom-team/jaklis
|
||||
|
||||
Files: *
|
||||
Copyright: <years> <put author's name and email here>
|
||||
<years> <likewise for another author>
|
||||
Copyright: 2021 Etienne Bouché <poka@p2p.legal>
|
||||
License: GPL-3.0+
|
||||
|
||||
Files: debian/*
|
||||
|
|
27
jaklis.py
27
jaklis.py
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python3.7
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse, sys, os, getpass, string, random
|
||||
from os.path import join, dirname
|
||||
|
@ -16,8 +16,19 @@ if not os.path.isfile(MY_PATH + '.env'):
|
|||
dotenv_path = join(dirname(__file__),MY_PATH + '.env')
|
||||
load_dotenv(dotenv_path)
|
||||
|
||||
# Set global values (default parameters) , regarding variables environments
|
||||
node = os.getenv('NODE')
|
||||
if not node:
|
||||
node="https://g1.librelois.fr/gva"
|
||||
|
||||
pod = os.getenv('POD')
|
||||
if not pod:
|
||||
pod="https://g1.data.le-sou.org"
|
||||
|
||||
destPubkey = False
|
||||
|
||||
# Parse arguments
|
||||
parser = argparse.ArgumentParser(description="Client CLI pour Cesium+ et Ḡchange")
|
||||
parser = argparse.ArgumentParser(description="Client CLI pour Cesium+ et Ḡchange", epilog="current node: '" + node + "', current pod: '" + pod + "'.")
|
||||
parser.add_argument('-v', '--version', action='store_true', help="Affiche la version actuelle du programme")
|
||||
parser.add_argument('-k', '--key', help="Chemin vers mon trousseau de clé (PubSec)")
|
||||
parser.add_argument('-n', '--node', help="Adresse du noeud Cesium+, Gchange ou Duniter à utiliser")
|
||||
|
@ -124,7 +135,7 @@ def createTmpDunikey():
|
|||
|
||||
key = SigningKey.from_credentials(getpass.getpass("Identifiant: "), getpass.getpass("Mot de passe: "), None)
|
||||
key.save_pubsec_file(keyPath)
|
||||
|
||||
|
||||
return keyPath
|
||||
|
||||
# Check if we need dunikey
|
||||
|
@ -170,10 +181,6 @@ if cmd in ("read","send","delete","set","get","erase","stars","unstars","getoffe
|
|||
|
||||
if args.node:
|
||||
pod = args.node
|
||||
else:
|
||||
pod = os.getenv('POD')
|
||||
if not pod:
|
||||
pod="https://g1.data.le-sou.org"
|
||||
|
||||
cesium = CesiumPlus(dunikey, pod, noNeedDunikey)
|
||||
|
||||
|
@ -232,15 +239,9 @@ elif cmd in ("pay","history","balance","id","idBalance","currentUd"):
|
|||
|
||||
if args.node:
|
||||
node = args.node
|
||||
else:
|
||||
node = os.getenv('NODE')
|
||||
if not node:
|
||||
node="https://g1.librelois.fr/gva"
|
||||
|
||||
if args.pubkey:
|
||||
destPubkey = args.pubkey
|
||||
else:
|
||||
destPubkey = False
|
||||
|
||||
gva = GvaApi(dunikey, node, destPubkey, noNeedDunikey)
|
||||
|
||||
|
|
Loading…
Reference in New Issue