nvm.aux_sys package

Submodules

nvm.aux_sys.aux_sys module

nvm.aux_sys.aux_sys.chdir(locations, log0=<Logger dummy (WARNING)>)[source]

Change current directory according to hostname and username.

Target directory path is relative to user’s ${HOME} directory.

Parameters
  • locations (Dict[str, Dict[str, Union[str, pathlib.Path]]]) – Dictionary containing locations, usernames and paths.

  • log0 (Optional[logging.Logger]) – Logger.

Examples

>>> import srsly
>>> import nvm
>>> locations = '''
>>> stardust7:
>>>   jiko: cc/dev/
>>> buka2:
>>>   jiko: cc/cfg/
>>> '''
>>> locations = srsly.yaml_loads(locations)
>>> print(nvm.chdir(locations))
Return type

str

nvm.aux_sys.aux_sys.pushdir(new_dir)[source]

Change dir context (non thread-safe).

Parameters

new_dir (Union[str, pathlib.Path]) – New (temporary path) paths.

Warning

This function is not thread-safe.

Examples

>>> import os
>>> from nvm import pushdir
>>> print(os.getcwd())
>>> with pushdir('/home/'):
>>>     print(os.getcwd())
>>>
>>> print(os.getcwd())
Return type

None

Module contents