summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2011-01-01 23:55:54 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:54 +0000
commit0090a798eb868ebc926944eac2e6d4a5aff3e1b3 (patch)
tree9b90e66234e6ad7b9616c8c5944029426746110f /bitbake/lib/bb/data_smart.py
parente8c48e668c7525257926ab7db9b6e44aa2705483 (diff)
downloadpoky-0090a798eb868ebc926944eac2e6d4a5aff3e1b3.tar.gz
bitbake: Sync a load of whitespace and other non-functionality changes with bitbake uptream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index ca72449b75..83e6f70cd7 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -28,10 +28,10 @@ BitBake build tools.
28# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 28# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29# Based on functions from the base bb module, Copyright 2003 Holger Schurig 29# Based on functions from the base bb module, Copyright 2003 Holger Schurig
30 30
31import copy, re, sys 31import copy, re
32from collections import MutableMapping 32from collections import MutableMapping
33import logging 33import logging
34import bb 34import bb, bb.codeparser
35from bb import utils 35from bb import utils
36from bb.COW import COWDictBase 36from bb.COW import COWDictBase
37 37
@@ -42,6 +42,7 @@ __setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend)(_(?P<
42__expand_var_regexp__ = re.compile(r"\${[^{}]+}") 42__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
43__expand_python_regexp__ = re.compile(r"\${@.+?}") 43__expand_python_regexp__ = re.compile(r"\${@.+?}")
44 44
45
45class VariableParse: 46class VariableParse:
46 def __init__(self, varname, d, val = None): 47 def __init__(self, varname, d, val = None):
47 self.varname = varname 48 self.varname = varname
@@ -72,11 +73,11 @@ class VariableParse:
72 self.references |= parser.references 73 self.references |= parser.references
73 self.execs |= parser.execs 74 self.execs |= parser.execs
74 75
75 value = utils.better_eval(codeobj, DataDict(self.d)) 76 value = utils.better_eval(codeobj, DataContext(self.d))
76 return str(value) 77 return str(value)
77 78
78 79
79class DataDict(dict): 80class DataContext(dict):
80 def __init__(self, metadata, **kwargs): 81 def __init__(self, metadata, **kwargs):
81 self.metadata = metadata 82 self.metadata = metadata
82 dict.__init__(self, **kwargs) 83 dict.__init__(self, **kwargs)
@@ -129,7 +130,7 @@ class DataSmart(MutableMapping):
129 130
130 def expand(self, s, varname): 131 def expand(self, s, varname):
131 return self.expandWithRefs(s, varname).value 132 return self.expandWithRefs(s, varname).value
132 133
133 134
134 def finalize(self): 135 def finalize(self):
135 """Performs final steps upon the datastore, including application of overrides""" 136 """Performs final steps upon the datastore, including application of overrides"""
@@ -291,7 +292,7 @@ class DataSmart(MutableMapping):
291 self._makeShadowCopy(var) 292 self._makeShadowCopy(var)
292 self.dict[var][flag] = flagvalue 293 self.dict[var][flag] = flagvalue
293 294
294 def getVarFlag(self, var, flag, expand = False): 295 def getVarFlag(self, var, flag, expand=False):
295 local_var = self._findVar(var) 296 local_var = self._findVar(var)
296 value = None 297 value = None
297 if local_var: 298 if local_var:
@@ -374,7 +375,7 @@ class DataSmart(MutableMapping):
374 value = self.getVar(variable, False) 375 value = self.getVar(variable, False)
375 for key in keys: 376 for key in keys:
376 referrervalue = self.getVar(key, False) 377 referrervalue = self.getVar(key, False)
377 if ref in referrervalue: 378 if referrervalue and ref in referrervalue:
378 self.setVar(key, referrervalue.replace(ref, value)) 379 self.setVar(key, referrervalue.replace(ref, value))
379 380
380 def localkeys(self): 381 def localkeys(self):