Decorator for a class using the @Command decorator. This decorator retrieve command info from each method and append it in to the SUBCOMMANDS class variable, which is later used to construct parser.
(cls)
| 892 | |
| 893 | |
| 894 | def ParseMethodSubCommands(cls): |
| 895 | """Decorator for a class using the @Command decorator. |
| 896 | |
| 897 | This decorator retrieve command info from each method and append it in to the |
| 898 | SUBCOMMANDS class variable, which is later used to construct parser. |
| 899 | """ |
| 900 | for unused_key, method in cls.__dict__.items(): |
| 901 | if hasattr(method, '__arg_attr'): |
| 902 | # pylint: disable=protected-access |
| 903 | cls.SUBCOMMANDS.append(method.__arg_attr) |
| 904 | return cls |
| 905 | |
| 906 | |
| 907 | class FileEntry: |
nothing calls this directly
no outgoing calls
no test coverage detected