From b846dd7f0bd3a52b4cbb1a9bbbb0ce7e5a9fbd8b Mon Sep 17 00:00:00 2001 From: Gaetan Jonathan Date: Mon, 4 Jul 2022 09:00:10 +0300 Subject: [PATCH] [ADD] logfile argument for Linux you can now specify a log file with -l argument ex: ampalibe -l ampalibe.log run --- ampalibe/__init__.py | 2 +- bin/ampalibe | 13 ++++++++----- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ampalibe/__init__.py b/ampalibe/__init__.py index a0b9459..bbafcc3 100644 --- a/ampalibe/__init__.py +++ b/ampalibe/__init__.py @@ -4,5 +4,5 @@ from .utils import action, command, Payload from .utils import translate, download_file, simulate -__version__ = '1.0.7' +__version__ = '1.0.8-dev' __author__ = 'iTeam-$' diff --git a/bin/ampalibe b/bin/ampalibe index 845e8ed..f1515a2 100755 --- a/bin/ampalibe +++ b/bin/ampalibe @@ -19,7 +19,7 @@ usage() { } # Analyse des parametres entrée avec la commande -while getopts "x:p:" option; do +while getopts "x:p:l:" option; do case "${option}" in x) python=${OPTARG} @@ -33,6 +33,9 @@ while getopts "x:p:" option; do usage fi ;; + l) + log=${OPTARG} + ;; *) usage ;; @@ -149,18 +152,18 @@ elif [ "$1" == "run" ]; then if [ "$2" = "--dev" ]; then if [ $python = "python3" ]; then - watchmedo auto-restart --patterns="*.py;.env" --recursive -- python3 -c 'import core;core.ampalibe.init.run(core.Configuration())' + watchmedo auto-restart --patterns="*.py;.env" --recursive -- python3 -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log else - watchmedo auto-restart --patterns="*.py;.env" --recursive -- python -c 'import core;core.ampalibe.init.run(core.Configuration())' + watchmedo auto-restart --patterns="*.py;.env" --recursive -- python -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log fi exit fi if [ $python = "python3" ]; then - python3 -c 'import core;core.ampalibe.init.run(core.Configuration())' + python3 -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log else - python -c 'import core;core.ampalibe.init.run(core.Configuration())' + python -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log fi else diff --git a/setup.cfg b/setup.cfg index b91c89e..de6ac5d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = Ampalibe -version = 1.0.7 +version = 1.0.8-dev author = iTeam-$ author_email = contact@iteam-s.mg description = Ampalibe is a light open source framework for bot messenger. diff --git a/setup.py b/setup.py index 764463e..86a79b4 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="ampalibe", # This is the name of the package - version='1.0.7', # The release version + version='1.0.8-dev', # The release version author="iTeam-$", # Full name of the author description="Ampalibe is a light open source framework for bot messenger.", long_description=long_description, # Long description read from the readme