[tracker/sam/umockdev: 63/64] trackertestutils: Add helper function to dconf module
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/sam/umockdev: 63/64] trackertestutils: Add helper function to dconf module
- Date: Sat, 13 Jun 2020 13:39:02 +0000 (UTC)
commit 6d407e8aad3fba2f869cd7ad922dc8e79a27d96e
Author: Sam Thursfield <sam afuera me uk>
Date: Fri May 22 20:58:54 2020 +0200
trackertestutils: Add helper function to dconf module
This saves a small amount of copy-paste code in tracker-miners.git.
utils/trackertestutils/sandbox.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/utils/trackertestutils/sandbox.py b/utils/trackertestutils/sandbox.py
index ff65b0c6b..ce2b51866 100644
--- a/utils/trackertestutils/sandbox.py
+++ b/utils/trackertestutils/sandbox.py
@@ -29,6 +29,7 @@ import os
import signal
from . import dbusdaemon
+from . import dconf
from . import psutil_mini as psutil
log = logging.getLogger(__name__)
@@ -130,5 +131,24 @@ class TrackerSandbox:
def get_connection(self):
return self.daemon.get_connection()
+
def get_session_bus_address(self):
return self.daemon.get_address()
+
+ def set_config(self, schema_config_dict):
+ """Set config values in multiple GSettings schemas.
+
+ Example input:
+
+ set_all({
+ 'org.freedesktop.Tracker3.Miner.Files': {
+ 'enable-writeback': GLib.Variant.new_boolean(False),
+ }
+ })
+
+ """
+
+ for schema_name, contents in schema_config_dict.items():
+ dconfclient = dconf.DConfClient(self)
+ for key, value in contents.items():
+ dconfclient.write(schema_name, key, value)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]