herge branch 'master' of github.com:F-WuTS/compLIB

This commit is contained in:
Konstantin Lampalzer 2021-10-14 13:59:27 +02:00
commit 3f0651abbc
4 changed files with 16 additions and 10 deletions

View file

@ -34,7 +34,7 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi
-d "python3-pigpio" \ -d "python3-pigpio" \
-d "python3-numpy" \ -d "python3-numpy" \
-d "ffmpeg" \ -d "ffmpeg" \
-v 0.2.6-1 -t deb setup.py -v 0.2.7-0 -t deb setup.py
# --deb-changelog changelog \ # --deb-changelog changelog \
# --deb-upstream-changelog changelog \ # --deb-upstream-changelog changelog \

View file

@ -1,3 +1,4 @@
import datetime
import os import os
import socket import socket
import threading import threading
@ -47,7 +48,7 @@ def get_ip():
s.connect(('10.255.255.255', 1)) s.connect(('10.255.255.255', 1))
IP = s.getsockname()[0] IP = s.getsockname()[0]
except Exception: except Exception:
IP = '127.0.0.1' IP = 'Not connected'
print(f"Error could not query ip: {e}") print(f"Error could not query ip: {e}")
finally: finally:
s.close() s.close()
@ -56,11 +57,16 @@ def get_ip():
def write_ip_to_screen(): def write_ip_to_screen():
while os.getenv("IP_OUTPUT", "true") == "true": while os.getenv("IP_OUTPUT", "true") == "true":
try:
ip = str(get_ip()) ip = str(get_ip())
print(f"writing {ip} to display") print(f"writing {ip} to display")
Logging.get_logger().info(f"writing {ip} to display") Logging.get_logger().info(f"writing {ip} to display")
Display.write(1, "Current IP:") Display.write(1, "Current IP:")
Display.write(2, ip) Display.write(2, ip)
Display.write(3, datetime.datetime.now().strftime("%b %d %Y %H:%M:%S"))
time.sleep(5)
except Exception as e:
print(f"Exception in write ip thread: {e}")
time.sleep(5) time.sleep(5)

View file

@ -1,4 +1,4 @@
__version__ = "0.2.6-1" __version__ = "0.2.7-0"
import importlib import importlib
import compLib.LogstashLogging import compLib.LogstashLogging

View file

@ -12,7 +12,7 @@ else:
setuptools.setup( setuptools.setup(
name="complib", name="complib",
version="0.2.6-1", version="0.2.7-0",
author="F-WuTs", author="F-WuTs",
author_email="--", author_email="--",
description="", description="",