The result of executing a CadQuery script. The success property contains whether the execution was successful. If successful, the results property contains a list of all results, and the first_result property contains the first result. If unsuccessful, the exception property c
| 153 | |
| 154 | |
| 155 | class BuildResult(object): |
| 156 | """ |
| 157 | The result of executing a CadQuery script. |
| 158 | The success property contains whether the execution was successful. |
| 159 | |
| 160 | If successful, the results property contains a list of all results, |
| 161 | and the first_result property contains the first result. |
| 162 | |
| 163 | If unsuccessful, the exception property contains a reference to |
| 164 | the stack trace that occurred. |
| 165 | """ |
| 166 | |
| 167 | def __init__(self): |
| 168 | self.buildTime = None |
| 169 | self.results = [] # list of ShapeResult |
| 170 | self.debugObjects = [] # list of ShapeResult |
| 171 | self.first_result = None |
| 172 | self.success = False |
| 173 | self.exception = None |
| 174 | |
| 175 | def set_failure_result(self, ex): |
| 176 | self.exception = ex |
| 177 | self.success = False |
| 178 | |
| 179 | def set_debug(self, debugObjects): |
| 180 | self.debugObjects = debugObjects |
| 181 | |
| 182 | def set_success_result(self, results): |
| 183 | self.results = results |
| 184 | if len(self.results) > 0: |
| 185 | self.first_result = self.results[0] |
| 186 | self.success = True |
| 187 | |
| 188 | |
| 189 | class ScriptMetadata(object): |