aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb/data.py')
-rw-r--r--lib/bb/data.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/bb/data.py b/lib/bb/data.py
index b7c28b26b..149f86a18 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -43,6 +43,16 @@ def init():
_data_dict = init()
+def createCopy(source):
+ """Link the source set to the destination
+ If one does not find the value in the destination set,
+ search will go on to the source set to get the value.
+ Value from source are copy-on-write. i.e. any try to
+ modify one of them will end up putting the modified value
+ in the destination set.
+ """
+ return source.createCopy()
+
def initVar(var, d = _data_dict):
"""Non-destructive var init for data structure"""
d.initVar(var)
@@ -142,11 +152,12 @@ def delVarFlags(var, d = _data_dict):
"""Removes a variable's flags
Example:
- >>> setVarFlag('TEST', 'testflag', 1)
- >>> print getVarFlag('TEST', 'testflag')
+ >>> data = init()
+ >>> setVarFlag('TEST', 'testflag', 1, data)
+ >>> print getVarFlag('TEST', 'testflag', data)
1
- >>> delVarFlags('TEST')
- >>> print getVarFlags('TEST')
+ >>> delVarFlags('TEST', data)
+ >>> print getVarFlags('TEST', data)
None
"""