It provides a new dict attribute process_env and a setter method called set_envvar.
The latter accepts two arguments: name and value
The name does not need to be passed in uppercase, and will automatically be prefixed with WHEN_CHANGED_ to prevent conflicts.
eg. self.set_envvar('myvar', 'myvalue') will result in an environment variable WHEN_CHANGED_MYVAR = myvalue.
It provides a new dict attribute
process_env
and a setter method calledset_envvar
. The latter accepts two arguments:name
andvalue
The name does not need to be passed in uppercase, and will automatically be prefixed withWHEN_CHANGED_
to prevent conflicts. eg. self.set_envvar('myvar', 'myvalue') will result in an environment variableWHEN_CHANGED_MYVAR
=myvalue
.Only the sub process is altered as suggested here https://github.com/joh/when-changed/pull/72#pullrequestreview-217539245 and shown here https://stackoverflow.com/questions/2231227/python-subprocess-popen-with-a-modified-environment
Signed-off-by: Eric Villard dev@eviweb.fr