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

Expand environment variables in gen_esp32part #301

Merged
merged 1 commit into from
Feb 22, 2017

Conversation

rojer
Copy link
Contributor

@rojer rojer commented Jan 26, 2017

Allows parametrizing partition table with (exported) make variables.

@@ -163,7 +164,9 @@ def __init__(self):
def from_csv(cls, line):
""" Parse a line from the CSV """
line_w_defaults = line + ",,,," # lazy way to support default fields
fields = [ f.strip() for f in line_w_defaults.split(",") ]
def expand_var(f):
return os.environ[f[1:]] if f.startswith("$") else f
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @rojer,

Sorry, this somehow fell off my radar for review.

I'm 100% OK with allowing environment variables in partition table definitions. I would prefer if we could allow mixing of variable references and plaintext in the same CSV field. Was hoping Python might have a function for this out of the box, but it looks like the best (simple) solution is a one-liner like in this SO answer: http://stackoverflow.com/a/30735354

Allows parametrizing partition table with (exported) make variables.
@rojer
Copy link
Contributor Author

rojer commented Feb 14, 2017

i thought about it too, didn't know about os.path.expandvars and decided to keep it simple.

PTAL

@projectgus
Copy link
Contributor

Thanks @rojer. LGTM, have put into our internal review/merge queue.

@projectgus projectgus added the Status: Pending blocked by some other factor label Feb 14, 2017
@igrr igrr merged commit 22c3877 into espressif:master Feb 22, 2017
igrr pushed a commit that referenced this pull request Feb 22, 2017
partition tables: Expand environment variables in gen_esp32part

Allows parametrizing partition table with (exported) make variables.

Merges PR #301 #301

See merge request !505
@igrr igrr removed the Status: Pending blocked by some other factor label Apr 12, 2017
@rojer rojer deleted the gen_part_vars branch April 26, 2017 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants