From 7f01cc678679eebd3e07f09d828aa97808f51f08 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 19 Jun 2024 09:36:38 -0400 Subject: [PATCH 1/2] Python: Correct Importing example Without this fix, we get a TypeError: TypeError: Must be mapping, not set --- docs/reference/libsecret/libsecret-using.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/libsecret/libsecret-using.md b/docs/reference/libsecret/libsecret-using.md index 1f51ce9..a8e80c8 100644 --- a/docs/reference/libsecret/libsecret-using.md +++ b/docs/reference/libsecret/libsecret-using.md @@ -57,7 +57,7 @@ from gi.repository import Secret # ... and a here's sample line of code which uses the import schema = Secret.Schema.new("org.mock.Schema", - Secret.SchemaFlags.NONE, { "name", Secret.SchemaAttributeType.STRING }) + Secret.SchemaFlags.NONE, { "name": Secret.SchemaAttributeType.STRING }) ``` ## Vala: Compiling with libsecret From f7e2b7884acfa9cb5797f84abafddd8b694159de Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 19 Jun 2024 18:58:48 -0400 Subject: [PATCH 2/2] 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. --- docs/reference/libsecret/libsecret-using.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/libsecret/libsecret-using.md b/docs/reference/libsecret/libsecret-using.md index a8e80c8..e2d4e93 100644 --- a/docs/reference/libsecret/libsecret-using.md +++ b/docs/reference/libsecret/libsecret-using.md @@ -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