diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2005-05-17 18:15:25 +0000 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2005-05-17 18:15:25 +0000 |
commit | 150d9f2341f546392d26992b2adac7e3d1344ea4 (patch) | |
tree | 862fd0f8d4fa38dd39b4d79f98cc6d18c691d40d /lib/bb/data.py | |
parent | c7f7cfd506f504f658088bc0c7ee9f487d8a3d3f (diff) | |
download | bitbake-150d9f2341f546392d26992b2adac7e3d1344ea4.tar.gz |
createCopy:
-Move a createCopy method into data.py
-Make code creating deepcopies of the data instance
use this new createCopy
Diffstat (limited to 'lib/bb/data.py')
-rw-r--r-- | lib/bb/data.py | 19 |
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 """ |