diff --git a/__pycache__/ui.cpython-311.pyc b/__pycache__/ui.cpython-311.pyc index db35bf9..a47c84f 100644 Binary files a/__pycache__/ui.cpython-311.pyc and b/__pycache__/ui.cpython-311.pyc differ diff --git a/__pycache__/users.cpython-311.pyc b/__pycache__/users.cpython-311.pyc index 1c084e8..62d96c4 100644 Binary files a/__pycache__/users.cpython-311.pyc and b/__pycache__/users.cpython-311.pyc differ diff --git a/ui.py b/ui.py index 18ce463..cccb30f 100644 --- a/ui.py +++ b/ui.py @@ -1,7 +1,5 @@ # Zeiterfassung # UI -from wx.lib.agw.aui import aero_up_single - from definitions import * import tkinter as tk @@ -20,7 +18,7 @@ def ui_stempeln(button, label): else: buttons[button].configure(relief="sunken", bg="green") -def stempeln(userlist): +def win_stempeln(userlist): stempeln = tk.Tk() stempeln.title(program_name + " " + program_version) stempeln.geometry("600x400") @@ -29,17 +27,18 @@ def stempeln(userlist): global buttons buttons = [ ] button_index = 0 - windowSize = stempeln.winfo_height() + stempeln.columnconfigure(0, weight=1) + stempeln.rowconfigure(0, weight=1) for i in userlist: - buttonheight = int(windowSize / len(userlist) - 10) - button = tk.Button(stempeln, text=i, height=buttonheight, command=lambda b=button_index, label=i: ui_stempeln(b, label)) + + button = tk.Button(stempeln, text=i, height=5, command=lambda b=button_index, label=i: ui_stempeln(b, label)) if len_timestamps(determine_filename(i)) % 2 == 0: button.configure(relief="raised", bg ="red") else: button.configure(relief="sunken", bg="green") - button.pack(fill="x", pady=5) + button.grid(row=button_index, column=0, sticky="ew") buttons.append(button) button_index+=1 diff --git a/users.py b/users.py index 0aedf62..1326ece 100644 --- a/users.py +++ b/users.py @@ -7,7 +7,8 @@ import datetime from definitions import * # Benutzer anhand Verzeichnisse auflisten -def list_users(directory): +def list_users(): + directory = scriptpath() + "/" + userfolder users = [d for d in os.listdir(directory) if os.path.isdir(os.path.join(directory, d))] return users @@ -23,7 +24,7 @@ def determine_filename(user, type="stamping"): # Benutzerliste anzeigen def printUserList(): - userlist = list_users(scriptpath() + "/" + userfolder) + userlist = list_users() for i in range(0, len(userlist)): print(str(i + 1) + ": " + str(userlist[i])) return(userlist) diff --git a/users/testuser/2025-4.txt b/users/testuser/2025-4.txt index 0f2a1af..c96cedb 100644 --- a/users/testuser/2025-4.txt +++ b/users/testuser/2025-4.txt @@ -72,3 +72,5 @@ 1744198071 1744198392 1744198393 +1744210902 +1744210904 diff --git a/users/testuser2/2025-4.txt b/users/testuser2/2025-4.txt index e1a06f5..c1403e5 100644 --- a/users/testuser2/2025-4.txt +++ b/users/testuser2/2025-4.txt @@ -18,3 +18,9 @@ 1744197306 1744197767 1744197768 +1744210910 +1744210912 +1744210913 +1744210914 +1744211937 +1744211939 diff --git a/zeiterfassung.py b/zeiterfassung.py index 1d25594..2cbcd9d 100644 --- a/zeiterfassung.py +++ b/zeiterfassung.py @@ -15,7 +15,7 @@ from ui import * def main(): userList = printUserList() - stempeln(userList) + win_stempeln(userList) exit() # Konsole