nicklan / Deluge-Pieces-Plugin

A plugin to show the status of each piece of a torrent in deluge
73 stars 34 forks source link

optional gtk dependency? #32

Open victornoel opened 2 years ago

victornoel commented 2 years ago

Hi, I'm using deluged in an environment where gtk is not installed and no python dependency for gtk is present, and when I try to load the plugin in deluged, I get the following error in the logs:

deluge-deluged-1  | 17:34:51 [ERROR   ][deluge.pluginmanagerbase            :154 ] Unable to instantiate plugin 'Pieces' from '/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg'!
deluge-deluged-1  | 17:34:51 [ERROR   ][deluge.pluginmanagerbase            :1343] Namespace Gtk not available
deluge-deluged-1  | Traceback (most recent call last):
deluge-deluged-1  |   File "/usr/lib/python3/dist-packages/deluge/pluginmanagerbase.py", line 148, in enable_plugin
deluge-deluged-1  |     instance = cls(plugin_name.replace('-', '_'))
deluge-deluged-1  |   File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/__init__.py", line 46, in __init__
deluge-deluged-1  |     from .core import Core as _plugin_cls
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
deluge-deluged-1  |   File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/core.py", line 49, in <module>
deluge-deluged-1  |     from .colors import Colors
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
deluge-deluged-1  |   File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/colors.py", line 40, in <module>
deluge-deluged-1  |     from .color import Color
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
deluge-deluged-1  |   File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
deluge-deluged-1  |   File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/color.py", line 42, in <module>
deluge-deluged-1  |     gi.require_version("Gtk", "3.0")
deluge-deluged-1  |   File "/usr/lib/python3/dist-packages/gi/__init__.py", line 130, in require_version
deluge-deluged-1  |     raise ValueError('Namespace %s not available' % namespace)
deluge-deluged-1  | ValueError: Namespace Gtk not available

I think it should be possible to not fail if GTK is missing and not try to load it?