[meld] settings: Add module global accessor to avoid import-time binding
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] settings: Add module global accessor to avoid import-time binding
- Date: Fri, 5 Jul 2019 01:24:42 +0000 (UTC)
commit 3142034d4d40ad1d2e2388200c8784b533e823dc
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Jul 5 09:49:56 2019 +1000
settings: Add module global accessor to avoid import-time binding
This hasn't been an issue until now because we've been careful to make
sure that settings setup happens early and doesn't import anything else
that might get an uninitialised `meldsettings` object. However, I'm
about to add some imports to this for style scheme initialisation
reasons, so we need this here.
...also it's the correct way to do what we're doing.
meld/settings.py | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/meld/settings.py b/meld/settings.py
index 3cb9b576..30a8b9e4 100644
--- a/meld/settings.py
+++ b/meld/settings.py
@@ -113,6 +113,10 @@ def bind_settings(obj):
settings.bind(settings_id, obj, property_id, bind_flags)
+def get_meld_settings() -> MeldSettings:
+ return meldsettings
+
+
settings = None
interface_settings = None
meldsettings = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]