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

Do you plan to call os.path.expandvars? #459

Open
Hajime-Saitou opened this issue May 12, 2023 · 0 comments
Open

Do you plan to call os.path.expandvars? #459

Hajime-Saitou opened this issue May 12, 2023 · 0 comments

Comments

@Hajime-Saitou
Copy link

I request to be able to fill in the environment variable name by calling os.path.environmentvars when setting the value in main.py#L98.

An environment variable name is, for example, %TEMP% (in Windows).

[.env]
LOG_DIR=%TEMP%\log

If possible, it would be nice if it could be called recursively. os.path.expandvars will only expand the environment variable name once.

def expandvarsRecursive(value):.
    expanded = os.path.expandvars(value)
    return value if expanded == value else expandvarsRecursive(expanded)

The reason for this is that if it is called recursively, we don't have to keep track of the same values.

[.env]
PROJECT_HOME=C:\project
LOG_DIR=%PROJECT_HOME%\log
TRACE_LOG_DIR=%LOG_DIR%\trace

Please consider this.

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

No branches or pull requests

1 participant