From 6032e549a5a58d542685168105987ef3f28224d5 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 28 Jun 2023 10:06:38 -0400 Subject: [PATCH] emmental: Use the gsetup.DEBUG_STR for appending "-debug" This lets us calculate if we're in debug-mode or not once, and reuse the result when needed. Signed-off-by: Anna Schumaker --- emmental/gsetup.py | 2 +- emmental/mpris2/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/emmental/gsetup.py b/emmental/gsetup.py index 1869bfa..4acd92a 100644 --- a/emmental/gsetup.py +++ b/emmental/gsetup.py @@ -17,7 +17,7 @@ gi.importlib.import_module("gi.repository.Gtk") gi.importlib.import_module("gi.repository.Gst").init(sys.argv) DEBUG_STR = "-debug" if __debug__ else "" -APPLICATION_ID = f"com.nowheycreamery.emmental{'-debug' if __debug__ else ''}" +APPLICATION_ID = f"com.nowheycreamery.emmental{DEBUG_STR}" CSS_FILE = pathlib.Path(__file__).parent / "emmental.css" CSS_PRIORITY = gi.repository.Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION diff --git a/emmental/mpris2/__init__.py b/emmental/mpris2/__init__.py index 773dcb3..991c0b1 100644 --- a/emmental/mpris2/__init__.py +++ b/emmental/mpris2/__init__.py @@ -2,10 +2,11 @@ """Implement the MPRIS2 Specification.""" from gi.repository import GObject from gi.repository import Gio +from .. import gsetup from . import application from . import player -MPRIS2_ID = f"org.mpris.MediaPlayer2.emmental{'-debug' if __debug__ else ''}" +MPRIS2_ID = f"org.mpris.MediaPlayer2.emmental{gsetup.DEBUG_STR}" class Connection(GObject.GObject):