Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[one-cmds] Implement get_arg_parser #13169

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

mhs4670go
Copy link
Contributor

This commit implements a funciton that gets argument parser from the given target.

Draft: #13161
ONE-DCO-1.0-Signed-off-by: seongwoo mhs4670go@naver.com

This commit implements a funciton that gets argument parser from the given target.

ONE-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
@mhs4670go mhs4670go added the PR/ready for review It is ready to review. Please review it. label Jun 12, 2024
@mhs4670go mhs4670go requested review from seanshpark and a team June 12, 2024 06:42
"""
if config_path is None:
return

parser = get_config_parser()
parser.read(config_path)

if not parser.has_section(section_to_parse) and quiet:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quiet arg is added because introducing [backend] section is not always exist for the backward compatability.

dir_path = os.path.dirname(os.path.realpath(__file__))
# for python module naming convention
target_name = target.replace('-', '_')
command_schema_path = dir_path + f'/../../backends/command/{cmd}/{target_name}.py'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional) if there some kind of path provider then we can ask that provider for this kind of information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's good point. I'll revise that later.

Copy link
Contributor

@seanshpark seanshpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seanshpark seanshpark requested a review from a team June 12, 2024 06:47
Copy link
Contributor

@shs-park shs-park left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
=)

@seanshpark seanshpark merged commit 297f7da into Samsung:master Jun 12, 2024
6 checks passed
@mhs4670go mhs4670go deleted the arg3 branch June 14, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR/ready for review It is ready to review. Please review it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants