S101: fix
This commit is contained in:
@@ -11,6 +11,7 @@ gi.require_version("Gtk", "4.0")
|
||||
gi.require_version("Adw", "1")
|
||||
|
||||
from clan_lib.custom_logger import setup_logging
|
||||
from clan_lib.errors import ClanError
|
||||
from gi.repository import Adw, Gdk, Gio, Gtk
|
||||
|
||||
from clan_vm_manager.components.interfaces import ClanConfig
|
||||
@@ -118,7 +119,9 @@ class MainApplication(Adw.Application):
|
||||
css_provider = Gtk.CssProvider()
|
||||
css_provider.load_from_path(str(resource_path))
|
||||
display = Gdk.Display.get_default()
|
||||
assert display is not None
|
||||
if display is None:
|
||||
msg = "Could not get default display"
|
||||
raise ClanError(msg)
|
||||
Gtk.StyleContext.add_provider_for_display(
|
||||
display,
|
||||
css_provider,
|
||||
|
||||
@@ -116,7 +116,9 @@ class ClanList(Gtk.Box):
|
||||
add_action = Gio.SimpleAction.new("add", GLib.VariantType.new("s"))
|
||||
add_action.connect("activate", self.on_add)
|
||||
app = Gio.Application.get_default()
|
||||
assert app is not None
|
||||
if app is None:
|
||||
msg = "Could not get default application"
|
||||
raise ClanError(msg)
|
||||
app.add_action(add_action)
|
||||
|
||||
# menu_model = Gio.Menu()
|
||||
@@ -214,7 +216,9 @@ class ClanList(Gtk.Box):
|
||||
build_logs_action.set_enabled(False)
|
||||
|
||||
app = Gio.Application.get_default()
|
||||
assert app is not None
|
||||
if app is None:
|
||||
msg = "Could not get default application"
|
||||
raise ClanError(msg)
|
||||
|
||||
app.add_action(open_action)
|
||||
app.add_action(build_logs_action)
|
||||
|
||||
Reference in New Issue
Block a user