mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 04:38:55 +00:00
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:
parent
7f01cc6786
commit
f7e2b7884a
@ -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:
|
In python use the standard introspection import mechanism to get at libsecret:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
import gi
|
||||||
|
gi.require_version("Secret", "1")
|
||||||
from gi.repository import Secret
|
from gi.repository import Secret
|
||||||
|
|
||||||
# ... and a here's sample line of code which uses the import
|
# ... and a here's sample line of code which uses the import
|
||||||
|
Loading…
Reference in New Issue
Block a user