The method SetInputData() is tried on the instantiated class. Some classes do not have an SetInputData method, if this is the case, Python will generate an AttributeError, in this case, the name of the class is stored in the global variable noUpdate and False is returned.
(b, e, d)
| 229 | raise |
| 230 | |
| 231 | def TrySetInputData(b, e, d): |
| 232 | ''' |
| 233 | The method SetInputData() is tried on the instantiated class. |
| 234 | |
| 235 | Some classes do not have an SetInputData method, if this is the case, |
| 236 | Python will generate an AttributeError, in this case, the name |
| 237 | of the class is stored in the global variable noUpdate and False |
| 238 | is returned. |
| 239 | |
| 240 | If an error occurs on SetInputData() then the error handler |
| 241 | will be triggered and in this case False is returned. |
| 242 | |
| 243 | :param: b - the class on which SetInputData() will be tried. |
| 244 | :param: e - the error handler. |
| 245 | :param: d - input data. |
| 246 | :return: True if the update was successful, False otherwise. |
| 247 | ''' |
| 248 | try: |
| 249 | b.SetInputData(d) |
| 250 | if e.ErrorOccurred(): |
| 251 | return False |
| 252 | else: |
| 253 | return True |
| 254 | except AttributeError: |
| 255 | # No SetInputData() method |
| 256 | noSetInput.add(b.GetClassName()) |
| 257 | return False |
| 258 | except: |
| 259 | raise |
| 260 | |
| 261 | def TestOne(cname): |
| 262 | ''' |
no test coverage detected