From 90417e002292b3982f8dff68fae4270bdbd9db5c Mon Sep 17 00:00:00 2001 From: qwint Date: Sun, 26 Jan 2025 07:06:27 -0500 Subject: [PATCH] CommonClient: Expand on make_gui docstring (#4449) * adds docstring to make_gui describing what things you might want to change without dealing with kivy/kvui directly (there are better places to document those) * Update CommonClient.py Co-authored-by: Doug Hoskisson * Update CommonClient.py Co-authored-by: Doug Hoskisson --------- Co-authored-by: Doug Hoskisson --- CommonClient.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index f6b2623f..996ba330 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -709,8 +709,16 @@ class CommonContext: logger.exception(msg, exc_info=exc_info, extra={'compact_gui': True}) self._messagebox_connection_loss = self.gui_error(msg, exc_info[1]) - def make_gui(self) -> typing.Type["kvui.GameManager"]: - """To return the Kivy App class needed for run_gui so it can be overridden before being built""" + def make_gui(self) -> "type[kvui.GameManager]": + """ + To return the Kivy `App` class needed for `run_gui` so it can be overridden before being built + + Common changes are changing `base_title` to update the window title of the client and + updating `logging_pairs` to automatically make new tabs that can be filled with their respective logger. + + ex. `logging_pairs.append(("Foo", "Bar"))` + will add a "Bar" tab which follows the logger returned from `logging.getLogger("Foo")` + """ from kvui import GameManager class TextManager(GameManager):