summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-04-11 17:03:55 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:33 +0100
commit1180bab54e2879401f3586c91a48174191a1ee8b (patch)
treea45aeee20eb5969cc1ac778fac47134929f4e021 /bitbake/lib/bb/data_smart.py
parent5b216c8000dbc3ed9f3e996242eb24269fcaf919 (diff)
downloadpoky-1180bab54e2879401f3586c91a48174191a1ee8b.tar.gz
Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c) Signed-off-by: Chris Larson <chris_larson@mentor.com> 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.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 2edeec064e..1704ed631c 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -66,10 +66,10 @@ class DataSmart:
66 code = match.group()[3:-1] 66 code = match.group()[3:-1]
67 codeobj = compile(code.strip(), varname or "<expansion>", "eval") 67 codeobj = compile(code.strip(), varname or "<expansion>", "eval")
68 s = utils.better_eval(codeobj, {"d": self}) 68 s = utils.better_eval(codeobj, {"d": self})
69 if type(s) == types.IntType: s = str(s) 69 if isinstance(s, types.IntType): s = str(s)
70 return s 70 return s
71 71
72 if type(s) is not types.StringType: # sanity check 72 if not isinstance(s, types.StringType): # sanity check
73 return s 73 return s
74 74
75 if varname and varname in self.expand_cache: 75 if varname and varname in self.expand_cache:
@@ -81,7 +81,7 @@ class DataSmart:
81 s = __expand_var_regexp__.sub(var_sub, s) 81 s = __expand_var_regexp__.sub(var_sub, s)
82 s = __expand_python_regexp__.sub(python_sub, s) 82 s = __expand_python_regexp__.sub(python_sub, s)
83 if s == olds: break 83 if s == olds: break
84 if type(s) is not types.StringType: # sanity check 84 if not isinstance(s, types.StringType): # sanity check
85 bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s)) 85 bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s))
86 except KeyboardInterrupt: 86 except KeyboardInterrupt:
87 raise 87 raise
@@ -118,7 +118,7 @@ class DataSmart:
118 l = len(o)+1 118 l = len(o)+1
119 119
120 # see if one should even try 120 # see if one should even try
121 if not self._seen_overrides.has_key(o): 121 if o not in self._seen_overrides:
122 continue 122 continue
123 123
124 vars = self._seen_overrides[o] 124 vars = self._seen_overrides[o]
@@ -130,7 +130,7 @@ class DataSmart:
130 bb.msg.note(1, bb.msg.domain.Data, "Untracked delVar") 130 bb.msg.note(1, bb.msg.domain.Data, "Untracked delVar")
131 131
132 # now on to the appends and prepends 132 # now on to the appends and prepends
133 if self._special_values.has_key("_append"): 133 if "_append" in self._special_values:
134 appends = self._special_values['_append'] or [] 134 appends = self._special_values['_append'] or []
135 for append in appends: 135 for append in appends:
136 for (a, o) in self.getVarFlag(append, '_append') or []: 136 for (a, o) in self.getVarFlag(append, '_append') or []:
@@ -145,7 +145,7 @@ class DataSmart:
145 self.setVar(append, sval) 145 self.setVar(append, sval)
146 146
147 147
148 if self._special_values.has_key("_prepend"): 148 if "_prepend" in self._special_values:
149 prepends = self._special_values['_prepend'] or [] 149 prepends = self._special_values['_prepend'] or []
150 150
151 for prepend in prepends: 151 for prepend in prepends:
@@ -215,7 +215,7 @@ class DataSmart:
215 # more cookies for the cookie monster 215 # more cookies for the cookie monster
216 if '_' in var: 216 if '_' in var:
217 override = var[var.rfind('_')+1:] 217 override = var[var.rfind('_')+1:]
218 if not self._seen_overrides.has_key(override): 218 if override not in self._seen_overrides:
219 self._seen_overrides[override] = set() 219 self._seen_overrides[override] = set()
220 self._seen_overrides[override].add( var ) 220 self._seen_overrides[override].add( var )
221 221
@@ -246,7 +246,7 @@ class DataSmart:
246 dest.extend(src) 246 dest.extend(src)
247 self.setVarFlag(newkey, i, dest) 247 self.setVarFlag(newkey, i, dest)
248 248
249 if self._special_values.has_key(i) and key in self._special_values[i]: 249 if i in self._special_values and key in self._special_values[i]:
250 self._special_values[i].remove(key) 250 self._special_values[i].remove(key)
251 self._special_values[i].add(newkey) 251 self._special_values[i].add(newkey)
252 252