mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-07-03 12:10:05 +02:00
Fix ruff lint violations
This commit is contained in:
@@ -4,11 +4,16 @@ from collections.abc import Callable
|
||||
from tkinter import messagebox, ttk
|
||||
|
||||
from ccma.domain.dates import format_date_for_display
|
||||
from ccma.domain.models import ASSET_STATUS_LABELS, MEMBERSHIP_STATUS_LABELS, Asset, HousekeeperFinding, Member
|
||||
from ccma.domain.models import (
|
||||
ASSET_STATUS_LABELS,
|
||||
MEMBERSHIP_STATUS_LABELS,
|
||||
Asset,
|
||||
HousekeeperFinding,
|
||||
Member,
|
||||
)
|
||||
from ccma.ui.labels import storage_key
|
||||
from ccma.ui.sections import titled_frame
|
||||
|
||||
|
||||
MEMBER_TABLE_COLUMNS = (
|
||||
("number", "Nummer", 110),
|
||||
("first_name", "Vorname", 160),
|
||||
@@ -306,7 +311,11 @@ class MembersTab(ttk.Frame):
|
||||
suffix = ""
|
||||
if key == self.sort_column:
|
||||
suffix = " v" if self.sort_descending else " ^"
|
||||
self.tree.heading(key, text=f"{title}{suffix}", command=lambda column=key: self._toggle_sort(column))
|
||||
self.tree.heading(
|
||||
key,
|
||||
text=f"{title}{suffix}",
|
||||
command=lambda column=key: self._toggle_sort(column),
|
||||
)
|
||||
|
||||
def _open_selected(self) -> None:
|
||||
selected = self.tree.selection()
|
||||
@@ -368,7 +377,11 @@ class AssetsTab(ttk.Frame):
|
||||
)
|
||||
self.status_filter.grid(row=0, column=1, sticky="w")
|
||||
self.status_filter.bind("<<ComboboxSelected>>", lambda _event: self._render_assets())
|
||||
self.tree = ttk.Treeview(self, columns=tuple(key for key, _title, _width in ASSET_TABLE_COLUMNS), show="headings")
|
||||
self.tree = ttk.Treeview(
|
||||
self,
|
||||
columns=tuple(key for key, _title, _width in ASSET_TABLE_COLUMNS),
|
||||
show="headings",
|
||||
)
|
||||
for key, title, width in ASSET_TABLE_COLUMNS:
|
||||
self.tree.heading(key, text=title, command=lambda column=key: self._toggle_sort(column))
|
||||
self.tree.column(key, width=width, anchor="w")
|
||||
@@ -377,13 +390,28 @@ class AssetsTab(ttk.Frame):
|
||||
self.tree.bind("<<TreeviewSelect>>", lambda _event: self._update_actions())
|
||||
actions = ttk.Frame(self)
|
||||
actions.grid(row=3, column=0, sticky="e", pady=(10, 0))
|
||||
self.edit_button = ttk.Button(actions, text="Bearbeiten", command=self._edit_selected, state="disabled")
|
||||
self.edit_button = ttk.Button(
|
||||
actions,
|
||||
text="Bearbeiten",
|
||||
command=self._edit_selected,
|
||||
state="disabled",
|
||||
)
|
||||
self.edit_button.pack(side="left", padx=(0, 8))
|
||||
self.open_button = ttk.Button(actions, text="Öffnen", command=self._open_selected, state="disabled")
|
||||
self.open_button.pack(side="left", padx=(0, 8))
|
||||
self.issue_button = ttk.Button(actions, text="Ausgeben", command=self._issue_selected, state="disabled")
|
||||
self.issue_button = ttk.Button(
|
||||
actions,
|
||||
text="Ausgeben",
|
||||
command=self._issue_selected,
|
||||
state="disabled",
|
||||
)
|
||||
self.issue_button.pack(side="left", padx=(0, 8))
|
||||
self.return_button = ttk.Button(actions, text="Zurücknehmen", command=self._return_selected, state="disabled")
|
||||
self.return_button = ttk.Button(
|
||||
actions,
|
||||
text="Zurücknehmen",
|
||||
command=self._return_selected,
|
||||
state="disabled",
|
||||
)
|
||||
self.return_button.pack(side="left")
|
||||
self.refresh(self.assets)
|
||||
|
||||
@@ -437,7 +465,11 @@ class AssetsTab(ttk.Frame):
|
||||
suffix = ""
|
||||
if key == self.sort_column:
|
||||
suffix = " v" if self.sort_descending else " ^"
|
||||
self.tree.heading(key, text=f"{title}{suffix}", command=lambda column=key: self._toggle_sort(column))
|
||||
self.tree.heading(
|
||||
key,
|
||||
text=f"{title}{suffix}",
|
||||
command=lambda column=key: self._toggle_sort(column),
|
||||
)
|
||||
|
||||
def _selected_asset_id(self) -> str:
|
||||
selected = self.tree.selection()
|
||||
|
||||
Reference in New Issue
Block a user