The method Shutdown() is tried on the instantiated class. Some classes do not have an Shutdown 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. If an er
(b, e)
| 200 | raise |
| 201 | |
| 202 | def TryShutdown(b, e): |
| 203 | ''' |
| 204 | The method Shutdown() is tried on the instantiated class. |
| 205 | |
| 206 | Some classes do not have an Shutdown method, if this is the case, |
| 207 | Python will generate an AttributeError, in this case, the name |
| 208 | of the class is stored in the global variable noUpdate and False |
| 209 | is returned. |
| 210 | |
| 211 | If an error occurs on Shutdown() then the error handler |
| 212 | will be triggered and in this case False is returned. |
| 213 | |
| 214 | :param: b - the class on which Shutdown() will be tried. |
| 215 | :param: e - the error handler. |
| 216 | :return: True if the update was successful, False otherwise. |
| 217 | ''' |
| 218 | try: |
| 219 | b.Shutdown() |
| 220 | if e.ErrorOccurred(): |
| 221 | return False |
| 222 | else: |
| 223 | return True |
| 224 | except AttributeError: |
| 225 | # No Shutdown() method |
| 226 | noShutdown.add(b.GetClassName()) |
| 227 | return False |
| 228 | except: |
| 229 | raise |
| 230 | |
| 231 | def TrySetInputData(b, e, d): |
| 232 | ''' |
no test coverage detected