add doc for environ.path

This commit is contained in:
Prodesire 2018-01-17 00:11:36 +08:00
parent 6b16e21305
commit 05c5f4e748
1 changed files with 13 additions and 0 deletions

View File

@ -15,3 +15,16 @@ Environ
...
a
.. py:function:: pydu.environ.path(append=None, prepend=None, replace=None)
Context manager for updating the PATH environment variable which
appends, prepends or replaces the PATH with given string or
a list of strings.
>>> import os
>>> from pydu.environ import path
>>> with path(append='/foo'):
... print(os.environ['PATH'])
...
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/foo