Skip to content

Commit

Permalink
Fixed imports, types etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Jan 6, 2025
1 parent 08623f0 commit 9b46997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gui/dialogs/auth_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import tkinter

from gui.icons import Icons
from gui.dialogs.help_dialog import show_help
from gui.icons import Icons


class AuthDialog(tkinter.Toplevel):
Expand Down
9 changes: 5 additions & 4 deletions src/gui/dialogs/help_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HelpDialog(tkinter.Toplevel):
def __init__(
self,
parent: Optional[tkinter.Toplevel],
title: Optional[str] = "Help",
title: str = "Help",
help_text: list[tuple[str, Optional[str]]] = [],
) -> None:
"""Perform initialization of help dialog."""
Expand All @@ -36,7 +36,8 @@ def __init__(

for t in help_text:
if len(t) == 2:
text.insert(tkinter.END, t[1] + "\n", t[0])
if t[1] is not None: # make type checker happy
text.insert(tkinter.END, t[1] + "\n", t[0])
else:
text.insert(tkinter.END, t[0] + "\n")

Expand Down Expand Up @@ -66,9 +67,9 @@ def ok(self) -> None:

def show_help() -> None:
"""Display help dialog."""
help_text = [
help_text : list[tuple[str, Optional[str]]] = [
("<h1>", "Road core service configuration editor"),
("<h2>", "Main help"),
("help text",),
("help text", None),
]
HelpDialog(None, help_text=help_text)

0 comments on commit 9b46997

Please sign in to comment.