From 15c2c3721366b2375330928516e1df62c463f7e1 Mon Sep 17 00:00:00 2001 From: raj_mathe Date: Sat, 30 Oct 2021 10:39:42 +0200 Subject: [PATCH] =?UTF-8?q?master=20>=20master:=20code=20-=20korrigierte?= =?UTF-8?q?=20Artefacterstellung=20f=C3=BCr=20python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/python/src/__main__.py | 33 +++++++++++++++++++++++++++++++++ scripts/.lib.sh | 8 ++++++++ scripts/build.sh | 1 - 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 code/python/src/__main__.py diff --git a/code/python/src/__main__.py b/code/python/src/__main__.py new file mode 100644 index 0000000..02b2a5e --- /dev/null +++ b/code/python/src/__main__.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# NOTE: This file is needed in addition to main.py +# for the creation of an artefact. +# It is stored one level higher than src. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# IMPORTS +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +import os; +import sys; + +sys.path.insert(0, os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))); + +from src.setup.cli import *; +from src.main import enter; + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# EXECUTION +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +if __name__ == '__main__': + sys.tracebacklimit = 0; + sys.tracebacklimit = 0; + try: + args = GetArgumentsFromCli(sys.argv[1:]); + except: + exit(1); + enter(quiet=args.quiet, debug=args.debug, mode=args.mode[0], path=args.path); diff --git a/scripts/.lib.sh b/scripts/.lib.sh index 93b7b84..0968b72 100644 --- a/scripts/.lib.sh +++ b/scripts/.lib.sh @@ -28,6 +28,14 @@ export PYTHON_APP_PREFIX=\ export USE_VENV=false; export UNITTEST_SCHEMA_PY="test_*.py"; +############################################################################## +# AUXILIARY METHODS: Zip +############################################################################## + +function create_zip_archive() { + zip -r $@; +} + ############################################################################## # AUXILIARY METHODS: Go ############################################################################## diff --git a/scripts/build.sh b/scripts/build.sh index c7ded64..3654fd3 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -37,7 +37,6 @@ elif [ "$mode" == "run" ]; then if [ "$lang" == "go" ]; then run_main_go $options; else #elif [ "$lang" == "python" ]; then - echo "options=$options;$SCRIPTARGS." run_main $options; fi else