diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-01 23:55:54 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:54 +0000 |
commit | 0090a798eb868ebc926944eac2e6d4a5aff3e1b3 (patch) | |
tree | 9b90e66234e6ad7b9616c8c5944029426746110f /bitbake/lib/bb/data_smart.py | |
parent | e8c48e668c7525257926ab7db9b6e44aa2705483 (diff) | |
download | poky-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.py | 15 |
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 | ||
31 | import copy, re, sys | 31 | import copy, re |
32 | from collections import MutableMapping | 32 | from collections import MutableMapping |
33 | import logging | 33 | import logging |
34 | import bb | 34 | import bb, bb.codeparser |
35 | from bb import utils | 35 | from bb import utils |
36 | from bb.COW import COWDictBase | 36 | from 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 | |||
45 | class VariableParse: | 46 | class 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 | ||
79 | class DataDict(dict): | 80 | class 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): |