equal
deleted
inserted
replaced
119 # location string for that CTN |
119 # location string for that CTN |
120 location_str = "_".join(map(str, self.GetCurrentLocation())) |
120 location_str = "_".join(map(str, self.GetCurrentLocation())) |
121 configname = self.GetCTRoot().GetProjectConfigNames()[0] |
121 configname = self.GetCTRoot().GetProjectConfigNames()[0] |
122 |
122 |
123 def _onchangecode(var): |
123 def _onchangecode(var): |
124 return [onchangecall.strip() + "('" + var.getname() + "')" |
124 result = [] |
125 for onchangecall in self.GetVarOnChangeContent(var).split(',')] |
125 for onchangecall in self.GetVarOnChangeContent(var).split(','): |
|
126 onchangecall = onchangecall.strip() |
|
127 if onchangecall: |
|
128 result.append(onchangecall + "('" + var.getname() + "')") |
|
129 return result |
|
130 |
126 |
131 |
127 def _onchange(var): |
132 def _onchange(var): |
128 content = self.GetVarOnChangeContent(var) |
133 content = self.GetVarOnChangeContent(var) |
129 return repr(content) if content else None |
134 return repr(content) if content else None |
130 |
135 |
167 """ % varinfo for varinfo in varinfos]) |
172 """ % varinfo for varinfo in varinfos]) |
168 |
173 |
169 on_change_func_body = "\n".join([""" |
174 on_change_func_body = "\n".join([""" |
170 if changes.next(): |
175 if changes.next(): |
171 # %(name)s |
176 # %(name)s |
172 try: |
177 try:""" % varinfo + """ |
173 """ % varinfo + """ |
|
174 """ + """ |
178 """ + """ |
175 """.join(varinfo['onchangecode'])+""" |
179 """.join(varinfo['onchangecode'])+""" |
176 except Exception as e: |
180 except Exception as e: |
177 errors.append("%(name)s: "+str(e)) |
181 errors.append("%(name)s: "+str(e)) |
178 """ % varinfo for varinfo in varinfos if varinfo["onchange"]]) |
182 """ % varinfo for varinfo in varinfos if varinfo["onchange"]]) |