Skip to content

Commit

Permalink
load_theme needs package_name for loading by name
Browse files Browse the repository at this point in the history
It is provided in every case, so add an assert to tell mypy about it.
  • Loading branch information
marmarek committed Jun 16, 2024
1 parent 807da20 commit 82fb69f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qubes_config/widgets/gtk_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ def load_theme(widget: Gtk.Widget, light_theme_path: Optional[str] = None,
:param dark_file_name: name of the css file with dark theme
"""
if not light_theme_path and light_file_name:
assert package_name
css_path = importlib.resources.files(package_name) / light_file_name
with importlib.resources.as_file(css_path) as resource_path:
light_theme_path = str(resource_path)
if not dark_theme_path and dark_file_name:
assert package_name
css_path = importlib.resources.files(package_name) / dark_file_name
with importlib.resources.as_file(css_path) as resource_path:
dark_theme_path = str(resource_path)
Expand Down

0 comments on commit 82fb69f

Please sign in to comment.