Skip to content

Commit

Permalink
Move non-instance application members to static fields
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
  • Loading branch information
polter-rnd committed Mar 18, 2023
1 parent a8cc1ae commit 7b86977
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bbswitch_gui/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
class Application(Gtk.Application):
"""Main application class allowing only one running instance."""

bbswitch = BBswitchMonitor()
client = BBswitchClient()
nvidia = NvidiaMonitor(timeout=REFRESH_TIMEOUT)

def __init__(self, *args, **kwargs) -> None:
"""Initialize application instance, setup command line handler."""
super().__init__(
Expand Down Expand Up @@ -62,10 +66,6 @@ def __init__(self, *args, **kwargs) -> None:
self.window: Optional[MainWindow] = None
self.indicator: Optional[Indicator] = None

self.bbswitch = BBswitchMonitor()
self.client = BBswitchClient()
self.nvidia = NvidiaMonitor(timeout=REFRESH_TIMEOUT)

def update_bbswitch(self) -> None:
"""Update GPU state from `bbswitch` module."""
logging.debug('Got update from bbswitch')
Expand Down

0 comments on commit 7b86977

Please sign in to comment.