Skip to content

Commit

Permalink
CommonClient: Expand on make_gui docstring (ArchipelagoMW#4449)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update CommonClient.py

Co-authored-by: Doug Hoskisson <[email protected]>

---------

Co-authored-by: Doug Hoskisson <[email protected]>
  • Loading branch information
qwint and beauxq authored Jan 26, 2025
1 parent 96b941e commit 90417e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CommonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,16 @@ def handle_connection_loss(self, msg: str) -> None:
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):
Expand Down

0 comments on commit 90417e0

Please sign in to comment.