-
Notifications
You must be signed in to change notification settings - Fork 159
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
Conversation
This commit implements a funciton that gets argument parser from the given target. ONE-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
""" | ||
if config_path is None: | ||
return | ||
|
||
parser = get_config_parser() | ||
parser.read(config_path) | ||
|
||
if not parser.has_section(section_to_parse) and quiet: |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
=)
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