From 9a58155e00fe784d30e22b5a43a79e2ec5099867 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Fri, 3 Nov 2023 17:31:07 +0100 Subject: [PATCH] Ansible adaptions --- .vscode/launch.json | 16 ++++++++++++++++ .vscode/settings.json | 14 ++++++++++++++ config_example/config.py | 10 +++++----- init_venv | 8 ++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100755 init_venv diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d9c13ed --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Attribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Main File execution", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/powerplug.py", + "console": "integratedTerminal", + "justMyCode": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ee25f90 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "python.defaultInterpreterPath": "./venv/bin/python", + "autopep8.args": ["--max-line-length=150"], + "[python]": { + "python.formatting.provider": "none", + "editor.defaultFormatter": "ms-python.autopep8", + "editor.formatOnSave": true + }, + "editor.fontSize": 14, + "emmet.includeLanguages": { "django-html": "html" }, + "python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} diff --git a/config_example/config.py b/config_example/config.py index b838d7a..2f198c7 100644 --- a/config_example/config.py +++ b/config_example/config.py @@ -3,10 +3,10 @@ import os import report -MQTT_USER = "user" -MQTT_PASS = "pass" -MQTT_SERVER = "localhost" -MQTT_TOPIC = "dirk/powerplug" +QTT_USER = "" +MQTT_PASS = "" +MQTT_SERVER = "" +MQTT_TOPIC = "" # # Logging @@ -14,7 +14,7 @@ MQTT_TOPIC = "dirk/powerplug" __BASEPATH__ = os.path.abspath(os.path.dirname(__file__)) APP_NAME = "powerplug" LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout' -LOGLVL = 'DEBUG' +LOGLVL = 'INFO' LOGHOST = 'cutelog' LOGPORT = 19996 diff --git a/init_venv b/init_venv new file mode 100755 index 0000000..428ff04 --- /dev/null +++ b/init_venv @@ -0,0 +1,8 @@ +#!/bin/sh +# +BASEPATH=`realpath $(dirname $0)` + +python3 -m venv $BASEPATH/venv +$BASEPATH/venv/bin/pip install --upgrade pip +find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r +$BASEPATH/venv/bin/pip list --outdated --format=json | jq -r '.[] | .name'|xargs -n1 $BASEPATH/venv/bin/pip install -U