diff --git a/__install__.py b/__install__.py deleted file mode 100644 index 3d93e4b..0000000 --- a/__install__.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/python -# -import os -import sys - -SERVICE_FILE = """ -[Unit] -Description=Smarthome IR Remote Control -After=network-online.target -Wants=network-online.target -[Service] -User=%(UID)d -Group=%(GID)d -ExecStart=%(MY_PATH)s/remote_control.sh -Type=simple -[Install] -WantedBy=default.target -""" - - -def help(): - print("Usage: prog ") - -if __name__ == "__main__": - if len(sys.argv) == 4: - try: - uid = int(sys.argv[1]) - gid = int(sys.argv[2]) - except ValueError: - help() - else: - if os.path.isdir(sys.argv[3]): - with open(os.path.join(sys.argv[3], 'remote_control.service'), "w") as fh: - fh.write(SERVICE_FILE % { - "MY_PATH": os.path.dirname(os.path.abspath(__file__)), - "UID": uid, - "GID": gid}) - else: - help() - else: - help() diff --git a/config_example/config.py b/config_example/config.py index eccfad0..1af406b 100644 --- a/config_example/config.py +++ b/config_example/config.py @@ -8,10 +8,10 @@ from remotes import technics_eur642100 as cd_player __BASEPATH__ = os.path.abspath(os.path.dirname(__file__)) -MQTT_USER = "mqtt_username" -MQTT_PASS = "mqtt_password" -MQTT_SERVER = "mqtt_server" -MQTT_TOPIC = "mqtt_topic" +MQTT_SERVER = "" +MQTT_USER = "" +MQTT_PASS = "" +MQTT_TOPIC = "" SUPPORTED_REMOTES = { amplifier.NAME: amplifier.ALL, @@ -23,7 +23,7 @@ SUPPORTED_REMOTES = { # APP_NAME = "remote_control" 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