From d283842f6beffc296d1b947eacab2d6354aac3d9 Mon Sep 17 00:00:00 2001 From: Ali Mirjamali Date: Mon, 8 Jul 2024 16:43:07 +0330 Subject: [PATCH] Making the Pylint happy for PR #197 --- qui/updater/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qui/updater/utils.py b/qui/updater/utils.py index 2e5355a6..2a646521 100644 --- a/qui/updater/utils.py +++ b/qui/updater/utils.py @@ -135,6 +135,8 @@ class QubeClass(Enum): AppVM = 3 DispVM = 4 +# pylint: disable=global-statement +# TODO: Encapsulate the below variable within a class __effective_css_provider__: Gtk.CssProvider = None def SetEffectiveCssProvider(CssProvider: Gtk.CssProvider) -> None: @@ -142,9 +144,8 @@ def SetEffectiveCssProvider(CssProvider: Gtk.CssProvider) -> None: __effective_css_provider__ = CssProvider def label_color_theme(color: str) -> str: - global __effective_css_provider__ widget = Gtk.Label() - if __effective_css_provider__ == None: + if not __effective_css_provider__: # Replicating the old behaviour. Both forward and backward compatible widget.get_style_context().add_class(f'qube-box-{color}') elif f'.qube-box-{color}' in __effective_css_provider__.to_string():