Skip to content

Commit

Permalink
remove ghost window when launched by "component" arg (ArchipelagoMW#9)
Browse files Browse the repository at this point in the history
* importing kivy opens a ghost window, this should type the relevant methods without needing to do that import

* type hint in the same format we import later to hopefully make tests happier

* one more try, this time with type_checking!
  • Loading branch information
qwint authored Jul 16, 2024
1 parent 358624a commit 2add1a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worlds/tracker/TrackerClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

from Generate import main as GMain, mystery_argparse

if typing.TYPE_CHECKING:
from kvui import GameManager

# webserver imports
import urllib.parse

Expand Down Expand Up @@ -69,7 +72,6 @@ def _cmd_reset_manually_collect(self):


class TrackerGameContext(CommonContext):
from kvui import GameManager
game = ""
httpServer_task: typing.Optional["asyncio.Task[None]"] = None
tags = CommonContext.tags | {"Tracker"}
Expand Down Expand Up @@ -112,7 +114,7 @@ def set_region_callback(self, func: Optional[Callable[[list[str]], bool]] = None
def set_events_callback(self, func: Optional[Callable[[list[str]], bool]] = None):
self.events_callback = func

def build_gui(self, manager: GameManager):
def build_gui(self, manager: "GameManager"):
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.tabbedpanel import TabbedPanelItem
from kivy.uix.recycleview import RecycleView
Expand Down

0 comments on commit 2add1a4

Please sign in to comment.