generated from dopt-python/py311
updated logging
This commit is contained in:
@@ -367,14 +367,26 @@ def get_leaf_dicts(data):
|
|||||||
|
|
||||||
|
|
||||||
def pprint_registry(widget_registry: WidgetRegistry) -> None:
|
def pprint_registry(widget_registry: WidgetRegistry) -> None:
|
||||||
print("---\n\n>>> Widget registry:")
|
print("\n\n>>> Widget registry:")
|
||||||
for key, entry in widget_registry.items():
|
for key, entry in widget_registry.items():
|
||||||
print(f"Key: {key}")
|
print(f"Key: {key}")
|
||||||
print(f"\twidget: {entry['widget']}")
|
print(f"\twidget: {entry['widget']}")
|
||||||
print(f"\tfield key: {entry['form_field'].key}")
|
print(f"\tfield key: {entry['form_field'].key}")
|
||||||
print(f"\tfield type: {entry['form_field'].type}")
|
print(f"\tfield type: {entry['form_field'].type}")
|
||||||
|
|
||||||
|
|
||||||
|
def pformat_registry(widget_registry: WidgetRegistry) -> str:
|
||||||
|
lines: list[str] = []
|
||||||
|
lines.append("\n\n>>> Widget registry:")
|
||||||
|
for key, entry in widget_registry.items():
|
||||||
|
lines.append(f"Key: {key}")
|
||||||
|
lines.append(f"\twidget: {entry['widget']}")
|
||||||
|
lines.append(f"\tfield key: {entry['form_field'].key}")
|
||||||
|
lines.append(f"\tfield type: {entry['form_field'].type}")
|
||||||
|
|
||||||
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
class FormFieldType(enum.StrEnum):
|
class FormFieldType(enum.StrEnum):
|
||||||
GROUP = enum.auto()
|
GROUP = enum.auto()
|
||||||
TEXT = enum.auto()
|
TEXT = enum.auto()
|
||||||
@@ -1719,6 +1731,11 @@ class AutoForm(QWidget):
|
|||||||
|
|
||||||
self.current_id: int = -1
|
self.current_id: int = -1
|
||||||
|
|
||||||
|
logger_auto_form.debug(
|
||||||
|
"Initialised Auto Form Widget. Registry:%s",
|
||||||
|
pformat_registry(self.widget_registry),
|
||||||
|
)
|
||||||
|
|
||||||
def _print_registry(self) -> None:
|
def _print_registry(self) -> None:
|
||||||
pprint_registry(self.widget_registry)
|
pprint_registry(self.widget_registry)
|
||||||
|
|
||||||
@@ -2475,7 +2492,9 @@ class NewEntrySelect_view(QWidget):
|
|||||||
btn_person.setFixedWidth(300)
|
btn_person.setFixedWidth(300)
|
||||||
btn_person.setFixedHeight(40)
|
btn_person.setFixedHeight(40)
|
||||||
btn_person.clicked.connect(lambda: self.person_requested.emit())
|
btn_person.clicked.connect(lambda: self.person_requested.emit())
|
||||||
btn_person.clicked.connect(lambda: print("Person gewählt"))
|
btn_person.clicked.connect(
|
||||||
|
lambda: logger_gui.info("[Grunderfassung: Dummy Individualperson] Person gewählt")
|
||||||
|
)
|
||||||
|
|
||||||
layout.addWidget(back_btn)
|
layout.addWidget(back_btn)
|
||||||
layout.addSpacing(15)
|
layout.addSpacing(15)
|
||||||
|
|||||||
Reference in New Issue
Block a user