From e7f0f95d664b220e8074fb90ec82f98f4bc85e1a Mon Sep 17 00:00:00 2001 From: Joel Klimont Date: Sat, 12 Feb 2022 13:16:26 +0100 Subject: [PATCH] updated version number to 0.4.0-0 added API_FORCE for overriding API_URL extensive logging is now disabled by default --- build_deb.sh | 2 +- compLib/Api.py | 7 +++++++ compLib/LogstashLogging.py | 2 +- compLib/__init__.py | 2 +- setup.py | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build_deb.sh b/build_deb.sh index 4b36fad..6ba60ec 100755 --- a/build_deb.sh +++ b/build_deb.sh @@ -34,7 +34,7 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi -d "python3-pigpio" \ -d "python3-numpy" \ -d "ffmpeg" \ - -v 0.3.9-0 -t deb setup.py + -v 0.4.0-0 -t deb setup.py # --deb-changelog changelog \ # --deb-upstream-changelog changelog \ diff --git a/compLib/Api.py b/compLib/Api.py index 6776af0..f36e79a 100644 --- a/compLib/Api.py +++ b/compLib/Api.py @@ -8,6 +8,13 @@ import requests from compLib.LogstashLogging import Logging API_URL = os.getenv("API_URL", "http://localhost:5000/") + "api/" + +api_override = os.getenv("API_FORCE", "") + +if api_override != "": + print(f"API_URL was set to {API_URL} but was overwritten with {api_override}") + API_URL = api_override + API_URL_GET_DELIVERY = API_URL + "getDelivery" API_URL_GET_MATERIAL = API_URL + "getMaterial" API_URL_GET_GARBAGE = API_URL + "getGarbage" diff --git a/compLib/LogstashLogging.py b/compLib/LogstashLogging.py index c766f74..b36196a 100644 --- a/compLib/LogstashLogging.py +++ b/compLib/LogstashLogging.py @@ -6,7 +6,7 @@ import requests from logstash_async.transport import HttpTransport from logstash_async.handler import AsynchronousLogstashHandler -EXTENSIVE_LOGGING = os.getenv("EXTENSIVE_LOGGING", "True") +EXTENSIVE_LOGGING = os.getenv("EXTENSIVE_LOGGING", "False") if EXTENSIVE_LOGGING == "True": EXTENSIVE_LOGGING = True diff --git a/compLib/__init__.py b/compLib/__init__.py index 10cd837..0110242 100644 --- a/compLib/__init__.py +++ b/compLib/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.3.9-0" +__version__ = "0.4.0-0" import importlib import compLib.LogstashLogging diff --git a/setup.py b/setup.py index 1258275..78a9f6e 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ else: setuptools.setup( name="complib", - version="0.3.9-0", + version="0.4.0-0", author="F-WuTs", author_email="--", description="",