| 180 | return slsmods[0] if len(slsmods) == 1 else slsmods |
| 181 | |
| 182 | def extend(self, *state_funcs): |
| 183 | if self.options.ordered or self.last_func(): |
| 184 | raise PyDslError("Cannot extend() after the ordered option was turned on!") |
| 185 | for f in state_funcs: |
| 186 | state_id = f.mod._state_id |
| 187 | self.extends.append(self.get_all_decls().pop(state_id)) |
| 188 | i = len(self.decls) |
| 189 | for decl in reversed(self.decls): |
| 190 | i -= 1 |
| 191 | if decl._id == state_id: |
| 192 | del self.decls[i] |
| 193 | break |
| 194 | |
| 195 | def state(self, id=None): |
| 196 | if not id: |