(self, description, app, subparsers, parent_parser=None)
| 38 | |
| 39 | class KeyValuePairBranch(resource.ResourceBranch): |
| 40 | def __init__(self, description, app, subparsers, parent_parser=None): |
| 41 | super(KeyValuePairBranch, self).__init__( |
| 42 | KeyValuePair, |
| 43 | description, |
| 44 | app, |
| 45 | subparsers, |
| 46 | parent_parser=parent_parser, |
| 47 | commands={ |
| 48 | "list": KeyValuePairListCommand, |
| 49 | "get": KeyValuePairGetCommand, |
| 50 | "delete": KeyValuePairDeleteCommand, |
| 51 | "create": NoopCommand, |
| 52 | "update": NoopCommand, |
| 53 | }, |
| 54 | ) |
| 55 | |
| 56 | # Registers extended commands |
| 57 | self.commands["set"] = KeyValuePairSetCommand( |
| 58 | self.resource, self.app, self.subparsers |
| 59 | ) |
| 60 | self.commands["load"] = KeyValuePairLoadCommand( |
| 61 | self.resource, self.app, self.subparsers |
| 62 | ) |
| 63 | self.commands["delete_by_prefix"] = KeyValuePairDeleteByPrefixCommand( |
| 64 | self.resource, self.app, self.subparsers |
| 65 | ) |
| 66 | |
| 67 | # Remove unsupported commands |
| 68 | # TODO: Refactor parent class and make it nicer |
| 69 | del self.commands["create"] |
| 70 | del self.commands["update"] |
| 71 | |
| 72 | |
| 73 | class KeyValuePairListCommand(resource.ResourceTableCommand): |
no test coverage detected