Skip to content

Commit

Permalink
[feature] Add API configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Zarubin committed Oct 1, 2024
1 parent d9a3efa commit 103da5b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
11 changes: 9 additions & 2 deletions aurora_cli/src/api/group_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import click

from aurora_cli.src.api.routes.routes_configuration import search_route_configuration
from aurora_cli.src.api.routes.routes_device import search_route_device
from aurora_cli.src.api.routes.routes_emulator import search_route_emulator
from aurora_cli.src.api.routes.routes_flutter import search_route_flutter
Expand Down Expand Up @@ -286,7 +287,7 @@
{TextCommand.command_vscode_settings_update()}
/vscode/settings/update
-- /settings ---------------------------------------------------
-- /settings -------------------------------------------------
{TextCommand.command_settings_list()}
/settings/list
Expand All @@ -310,7 +311,12 @@
/settings/hint
• enable [false, true] - {TextArgument.argument_enable_hint()}
-- /tests ---------------------------------------------------
-- /configuration --------------------------------------------
{TextCommand.command_configuration_path()}
/configuration/path
-- /tests ----------------------------------------------------
{TextCommand.command_test_answer()}
/tests/answer
Expand All @@ -335,6 +341,7 @@ def group_api(route: str):
search_route_sdk,
search_route_vscode,
search_route_settings,
search_route_configuration,
search_route_tests,
]:
if func(route):
Expand Down
30 changes: 30 additions & 0 deletions aurora_cli/src/api/routes/routes_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
Copyright 2024 Vitaliy Zarubin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from aurora_cli.src.base.constants.config import CONFIG_PATH
from aurora_cli.src.base.utils.output import echo_stdout, OutResult
from aurora_cli.src.base.utils.path import path_convert_relative
from aurora_cli.src.base.utils.route import get_route_root


def search_route_configuration(route: str) -> bool:
root = get_route_root(route)
if root == '/configuration/path':
echo_stdout(OutResult(value='{}'.format(path_convert_relative(CONFIG_PATH))))
else:
return False

return True
6 changes: 5 additions & 1 deletion aurora_cli/src/base/localization/ru/ru_app_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,8 @@ def command_settings_hint():

@staticmethod
def command_test_answer():
return 'Тестовые ответы API.'
return 'Тестовые ответы API.'

@staticmethod
def command_configuration_path():
return 'Путь к конфигурации.'
5 changes: 5 additions & 0 deletions aurora_cli/src/base/texts/app_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,8 @@ def command_settings_hint():
@localization
def command_test_answer():
return 'Test answers API.'

@staticmethod
@localization
def command_configuration_path():
return 'Path to configuration.'

0 comments on commit 103da5b

Please sign in to comment.