diff configmix/config.py @ 404:6a5aea02f3d0

Implement a ".is_jail" flag for configuration objects: to test/assert whether we expect a jail configuration
author Franz Glasner <f.glasner@feldmann-mg.com>
date Fri, 19 Nov 2021 12:40:23 +0100
parents 727ec2fc8e7e
children af367e1d0950
line wrap: on
line diff
--- a/configmix/config.py	Fri Nov 19 09:31:26 2021 +0100
+++ b/configmix/config.py	Fri Nov 19 12:40:23 2021 +0100
@@ -73,6 +73,9 @@
     _QUOTE = u(b'%')
     _COMMENT = u(b'#')
 
+    is_jail = False
+    """Flag to show that this is not a jail for another configuration"""
+
     def getvarl(self, *path, **kwds):
         """Get a variable where the hierarchy is given in `path` as sequence
         and the namespace is given in the `namespace` keyword argument.
@@ -708,6 +711,9 @@
 
     __slots__ = ("_base", "_path", "_pathstr")
 
+    is_jail = True
+    """Flag to show that this is a jail for another configuration"""
+
     def __init__(self, config, *path):
         super(_JailedConfiguration, self).__init__()
         self._base = config