|
1 | | -# -------------------------------------------------------------------------------------------- |
2 | | -# Copyright (c) Microsoft Corporation. All rights reserved. |
3 | | -# Licensed under the MIT License. See License.txt in the project root for license information. |
4 | | -# -------------------------------------------------------------------------------------------- |
5 | | - |
6 | | -from azure.cli.core import AzCommandsLoader |
7 | | -from .generated._help import helps # pylint: disable=unused-import |
8 | | - |
9 | | - |
10 | | -class PortalCommandsLoader(AzCommandsLoader): |
11 | | - |
12 | | - def __init__(self, cli_ctx=None): |
13 | | - from azure.cli.core.commands import CliCommandType |
14 | | - from .generated._client_factory import cf_portal |
15 | | - portal_custom = CliCommandType( |
16 | | - operations_tmpl='azext_portal.custom#{}', |
17 | | - client_factory=cf_portal) |
18 | | - super(PortalCommandsLoader, self).__init__(cli_ctx=cli_ctx, |
19 | | - custom_command_type=portal_custom) |
20 | | - |
21 | | - def load_command_table(self, args): |
22 | | - from .generated.commands import load_command_table |
23 | | - load_command_table(self, args) |
24 | | - return self.command_table |
25 | | - |
26 | | - def load_arguments(self, command): |
27 | | - from .generated._params import load_arguments |
28 | | - load_arguments(self, command) |
29 | | - |
30 | | - |
31 | | -COMMAND_LOADER_CLS = PortalCommandsLoader |
| 1 | +# -------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See License.txt in the project root for |
| 4 | +# license information. |
| 5 | +# |
| 6 | +# Code generated by Microsoft (R) AutoRest Code Generator. |
| 7 | +# Changes may cause incorrect behavior and will be lost if the code is |
| 8 | +# regenerated. |
| 9 | +# -------------------------------------------------------------------------- |
| 10 | + |
| 11 | +from azure.cli.core import AzCommandsLoader |
| 12 | +from azext_portal.generated._help import helps # pylint: disable=unused-import |
| 13 | + |
| 14 | + |
| 15 | +class PortalCommandsLoader(AzCommandsLoader): |
| 16 | + |
| 17 | + def __init__(self, cli_ctx=None): |
| 18 | + from azure.cli.core.commands import CliCommandType |
| 19 | + from azext_portal.generated._client_factory import cf_portal |
| 20 | + portal_custom = CliCommandType( |
| 21 | + operations_tmpl='azext_portal.custom#{}', |
| 22 | + client_factory=cf_portal) |
| 23 | + super(PortalCommandsLoader, self).__init__(cli_ctx=cli_ctx, |
| 24 | + custom_command_type=portal_custom) |
| 25 | + |
| 26 | + def load_command_table(self, args): |
| 27 | + from azext_portal.generated.commands import load_command_table |
| 28 | + load_command_table(self, args) |
| 29 | + try: |
| 30 | + from azext_portal.manual.commands import load_command_table as load_command_table_manual |
| 31 | + load_command_table_manual(self, args) |
| 32 | + except ImportError: |
| 33 | + pass |
| 34 | + return self.command_table |
| 35 | + |
| 36 | + def load_arguments(self, command): |
| 37 | + from azext_portal.generated._params import load_arguments |
| 38 | + load_arguments(self, command) |
| 39 | + try: |
| 40 | + from azext_portal.manual._params import load_arguments as load_arguments_manual |
| 41 | + load_arguments_manual(self, command) |
| 42 | + except ImportError: |
| 43 | + pass |
| 44 | + |
| 45 | + |
| 46 | +COMMAND_LOADER_CLS = PortalCommandsLoader |
0 commit comments