gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-bank] 03/04: cross-platform cli script


From: gnunet
Subject: [taler-bank] 03/04: cross-platform cli script
Date: Mon, 09 Nov 2020 16:43:37 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository bank.

commit 8e5f0883697df67b617c0c1e62515be57bbb3160
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Nov 9 16:36:15 2020 +0100

    cross-platform cli script
---
 pyproject.toml                            |  3 +++
 bin/taler-bank-manage => talerbank/cli.py | 13 +++++--------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index dd81a17..23a4dd6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -22,6 +22,9 @@ pylint = "^2.6.0"
 django = "^3.1.3"
 black = "^20.8b1"
 
+[tool.poetry.scripts]
+taler-bank-manage = 'talerbank.cli:run'
+
 [build-system]
 requires = ["poetry>=0.12"]
 build-backend = "poetry.masonry.api"
diff --git a/bin/taler-bank-manage b/talerbank/cli.py
old mode 100755
new mode 100644
similarity index 94%
rename from bin/taler-bank-manage
rename to talerbank/cli.py
index e1814c4..43d6a3c
--- a/bin/taler-bank-manage
+++ b/talerbank/cli.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
 ##
 # This file is part of TALER
 # (C) 2017 Taler Systems SA
@@ -31,11 +29,10 @@ import logging
 import inspect
 import click
 
-import talerbank
 from taler.util.talerconfig import TalerConfig
 from django.core.management import call_command
 
-SITE_PACKAGES = os.path.abspath(os.path.dirname(inspect.getfile(talerbank)) + 
"/..")
+SITE_PACKAGES = os.path.abspath(os.path.dirname(__file__) + "/..")
 
 LOGGER = logging.getLogger(__name__)
 
@@ -50,7 +47,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", 
"talerbank.settings")
     help="Set HTTP as the serving protocol (taking precedence over the 
config.), and set the port.",
     type=int
 )
-@click.option("-c", "--config", help="Path to the config file.")
+@click.option("--config", help="Path to the config file.")
 @click.option("--with-db", help="Database connection string.")
 def cli(ctx, http_port, config, with_db):
     if with_db:
@@ -77,8 +74,7 @@ def serve(obj):
 
 @cli.command(
     help="Invoke 'django' sub-commands",
-    context_settings=dict(ignore_unknown_options=True),
-    name="django"
+    context_settings=dict(ignore_unknown_options=True)
 )
 @click.argument("args", nargs=-1, type=click.UNPROCESSED)
 def handle_django(args):
@@ -150,4 +146,5 @@ def config():
     TC = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
     TC.dump()
 
-cli()
+def run():
+    cli()

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]