Python examples: use gi.require_version("Secret", "1")

This is the standard mechanism to initialize a GObject introspectable
interface.  If you don't do this, you get this PyGIWarning:

  Secret was imported without specifying a version first. Use
  gi.require_version('Secret', '1') before import to ensure that the
  right version gets loaded.
This commit is contained in:
Daniel Kahn Gillmor 2024-06-19 18:58:48 -04:00
parent 7f01cc6786
commit f7e2b7884a

View File

@ -53,6 +53,8 @@ var schema = new Secret.Schema.new("org.mock.Schema",
In python use the standard introspection import mechanism to get at libsecret:
```python
import gi
gi.require_version("Secret", "1")
from gi.repository import Secret
# ... and a here's sample line of code which uses the import