Yin-Yang icon indicating copy to clipboard operation
Yin-Yang copied to clipboard

`Plugin.available` is interpreted as a method reference instead of property access

Open mgsloan opened this issue 1 year ago • 1 comments

Describe the bug

Just running yin-yang works. I'm using xmonad as my window manager, so XDG_CURRENT_DESKTOP is not set and so plugins specific to desktop environments do not work. I tried XDG_CURRENT_DESKTOP=gnome yin-yang but then get:

Plugin Colors has no support for your desktop environment yet!
Plugin Icons has no support for your desktop environment yet!
No such schema “org.gnome.shell.extensions.user-theme”
Error while loading translation. Using default language.
No such schema “org.gnome.shell.extensions.user-theme”
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/yin-yang/yin_yang/__main__.py", line 134, in <module>
    window = main_window_connector.MainWindow()
  File "/opt/yin-yang/yin_yang/ui/main_window_connector.py", line 55, in __init__
    self.load()
  File "/opt/yin-yang/yin_yang/ui/main_window_connector.py", line 91, in load
    self.load_plugins()
  File "/opt/yin-yang/yin_yang/ui/main_window_connector.py", line 126, in load_plugins
    widget = plugin.get_widget(self.ui.plugins_scroll_content)
  File "/opt/yin-yang/yin_yang/plugins/_plugin.py", line 71, in get_widget
    widget.setVisible(self.available)
TypeError: 'PySide6.QtWidgets.QWidget.setVisible' called with wrong argument types:
  PySide6.QtWidgets.QWidget.setVisible(method)
Supported signatures:
  PySide6.QtWidgets.QWidget.setVisible(bool)

So, it seems like the Plugin.available property is being interpreted as a method reference instead of a property access. Totally mysterious to me why this would happen.

Affected versions

Yin-Yang head de1f3eb5c81f90657685503eb317e1fe91c57273

mgsloan avatar Jan 13 '24 16:01 mgsloan

I forgot to add @property to the gnome implementation, whoops

l0drex avatar Jan 14 '24 16:01 l0drex