diff --git a/__pycache__/definitions.cpython-311.pyc b/__pycache__/definitions.cpython-311.pyc index 7c779a4..20b8dd3 100644 Binary files a/__pycache__/definitions.cpython-311.pyc and b/__pycache__/definitions.cpython-311.pyc differ diff --git a/__pycache__/users.cpython-311.pyc b/__pycache__/users.cpython-311.pyc index 3659f8b..fd530c4 100644 Binary files a/__pycache__/users.cpython-311.pyc and b/__pycache__/users.cpython-311.pyc differ diff --git a/users.py b/users.py index ad76842..a4ea0a3 100644 --- a/users.py +++ b/users.py @@ -13,9 +13,9 @@ from definitions import userfolder, scriptpath, usersettingsfilename, photofilen class user: def __init__(self, name): - self.userfolder = scriptpath + "/" + userfolder + "/" + name - self.settingsfile = self.userfolder + "/" + usersettingsfilename - self.photofile = self.userfolder + "/" + photofilename + self.userfolder = f"{scriptpath}/{userfolder}/{name}" + self.settingsfile = f"{self.userfolder}/{usersettingsfilename}" + self.photofile = f"{self.userfolder}/{photofilename}" # Stammdaten einlesen try: @@ -33,7 +33,7 @@ class user: def get_stamp_file(self): year = str(datetime.datetime.now().year) month = str(datetime.datetime.now().month) - completepath = self.userfolder + "/" + year + "-" + month + ".txt" + completepath = f"{self.userfolder}/{year}-{month}.txt" return completepath def timestamp(self): diff --git a/users/test/2025-4.txt b/users/test/2025-4.txt index e69de29..1592319 100644 --- a/users/test/2025-4.txt +++ b/users/test/2025-4.txt @@ -0,0 +1,4 @@ +1744989835 +1744989837 +1744989913 +1744989917 diff --git a/users/testuser/2025-4.txt b/users/testuser/2025-4.txt index 421273c..ff9610d 100644 --- a/users/testuser/2025-4.txt +++ b/users/testuser/2025-4.txt @@ -6,3 +6,11 @@ 1743966049 1743967346 1744889948 +1744889966 +1744989797 +1744989827 +1744989830 +1744989883 +1744989909 +1744989914 +1744989916 diff --git a/users/testuser/photo.jpg b/users/testuser/photo.jpg new file mode 100644 index 0000000..dcaa401 Binary files /dev/null and b/users/testuser/photo.jpg differ diff --git a/users/testuser2/2025-4.txt b/users/testuser2/2025-4.txt index 9189aba..a007095 100644 --- a/users/testuser2/2025-4.txt +++ b/users/testuser2/2025-4.txt @@ -1,2 +1,8 @@ 1743966330 1743966416 +1744989832 +1744989834 +1744989905 +1744989907 +1744989915 +1744989916 diff --git a/web_ui.py b/web_ui.py index 9ae5674..8cffb07 100644 --- a/web_ui.py +++ b/web_ui.py @@ -1,5 +1,5 @@ from gi.overrides.keysyms import value -from nicegui import ui +from nicegui import ui, events from users import * from definitions import * @@ -15,16 +15,32 @@ def page_stamping(): def page_touchscreen(): def button_click(name): - ui.notify(name) + nonlocal buttons + current_user = user(name) + current_user.timestamp() + if current_user.stamp_status() == status_in: + buttons[name].props('color=green') + ui.notify(status_in) + else: + buttons[name].props('color=red') + ui.notify(status_out) + ui.markdown(f"##{app_title} {app_version}") + ui.html('