Remove an addon and all its sub-addons. If the addon is not in the chain - that is, if it's managed by a parent addon - it's the parent's responsibility to remove it from its own addons attribute.
(self, addon)
| 204 | self.chain.append(self.register(i)) |
| 205 | |
| 206 | def remove(self, addon): |
| 207 | """ |
| 208 | Remove an addon and all its sub-addons. |
| 209 | |
| 210 | If the addon is not in the chain - that is, if it's managed by a |
| 211 | parent addon - it's the parent's responsibility to remove it from |
| 212 | its own addons attribute. |
| 213 | """ |
| 214 | for a in traverse([addon]): |
| 215 | n = _get_name(a) |
| 216 | if n not in self.lookup: |
| 217 | raise exceptions.AddonManagerError("No such addon: %s" % n) |
| 218 | self.chain = [i for i in self.chain if i is not a] |
| 219 | del self.lookup[_get_name(a)] |
| 220 | self.invoke_addon_sync(addon, hooks.DoneHook()) |
| 221 | |
| 222 | def __len__(self): |
| 223 | return len(self.chain) |