The proposed change
Allow stand-alone Python script access to the Quodlibet library as @lazka described in #1939 for Quodlibet 3.6
import os, sys
sys.path.insert(0, '/home/david/quodlibet')
import quodlibet
from quodlibet import library
quodlibet.init()
lib = library.init(os.path.join(quodlibet.get_user_dir(), "songs"))
With Quodlibet 4.6.1 this script fails with the following:
/home/david/quodlibet/quodlibet/qltk/__init__.py:21: PyGIWarning: PangoCairo was imported without specifying a version first. Use gi.require_version('PangoCairo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, PangoCairo
Traceback (most recent call last):
File "/home/david/PycharmProjects/qlbridge/access.py", line 8, in <module>
quodlibet.init()
File "/home/david/quodlibet/quodlibet/_init.py", line 55, in init
init_cli(no_translations=no_translations, config_file=config_file)
File "/home/david/quodlibet/quodlibet/_init.py", line 136, in init_cli
_init_gettext(no_translations)
File "/home/david/quodlibet/quodlibet/_init.py", line 76, in _init_gettext
i18n.init(language)
File "/home/david/quodlibet/quodlibet/util/i18n.py", line 282, in init
assert "gi.repository.Gtk" not in sys.modules
AssertionError
Benefits of this change
I'll continue to use a script in newer Quodlibet versions to obtain & work with the song tag values extracted from the Quodlibet library, to support remote Quodlibet operation with simplified query creation from a mobile phone or tablet.
Any issues this might cause
I'm not sure if this is a documentation request for the Development Guide or FAQ, or a code change would be required.
enhancement