-
Notifications
You must be signed in to change notification settings - Fork 1
feat: lazy loading for constants and soc_header in bool_parser (RDT-1071) #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,15 +25,6 @@ | |
| opAssoc, | ||
| ) | ||
|
|
||
| from .constants import ( | ||
| IDF_VERSION, | ||
| IDF_VERSION_MAJOR, | ||
| IDF_VERSION_MINOR, | ||
| IDF_VERSION_PATCH, | ||
| ) | ||
| from .soc_header import ( | ||
| SOC_HEADERS, | ||
| ) | ||
| from .utils import ( | ||
| InvalidInput, | ||
| to_version, | ||
|
|
@@ -82,6 +73,20 @@ def get_value(self, target: str, config_name: str) -> t.Any: | |
| if self.attr == 'IDF_TARGET': | ||
| return target | ||
|
|
||
| if self.attr == 'CONFIG_NAME': | ||
| return config_name | ||
|
|
||
| # for non-keyword cap words, check if it is defined in the environment variables | ||
| if self.attr in os.environ: | ||
| return os.environ[self.attr] | ||
|
|
||
| from .constants import ( | ||
| IDF_VERSION, | ||
| IDF_VERSION_MAJOR, | ||
| IDF_VERSION_MINOR, | ||
| IDF_VERSION_PATCH, | ||
| ) | ||
|
|
||
| if self.attr == 'IDF_VERSION': | ||
| return IDF_VERSION | ||
|
|
||
|
|
@@ -94,16 +99,11 @@ def get_value(self, target: str, config_name: str) -> t.Any: | |
| if self.attr == 'IDF_VERSION_PATCH': | ||
| return IDF_VERSION_PATCH | ||
|
|
||
| if self.attr == 'CONFIG_NAME': | ||
| return config_name | ||
| from .soc_header import SOC_HEADERS | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about we prioritize loading the environment variables? so if I rely on one env var defined locally, there's no need to check and load the IDF_PATH (which may not exist) The original comment:
no idea why I put it here... I can't think of a real risk about it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. overall the sequence could be
|
||
|
|
||
| if self.attr in SOC_HEADERS[target]: | ||
| return SOC_HEADERS[target][self.attr] | ||
|
|
||
| # for non-keyword cap words, check if it is defined in the environment variables | ||
| if self.attr in os.environ: | ||
| return os.environ[self.attr] | ||
|
|
||
| return 0 # default return 0 as false | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.