"""Points das_shell at the source tree and a scratch /etc before it is imported.""" import os import sys import tempfile HERE = os.path.dirname(os.path.abspath(__file__)) FILES = os.path.dirname(HERE) SCRATCH = tempfile.mkdtemp(prefix="das-shell-test-") os.environ.update({ "DAS_SHELL_DATA": os.path.join(FILES, "share"), "DAS_SHELL_LIB": FILES, "DAS_SHELL_ETC": os.path.join(SCRATCH, "etc"), "DAS_SHELL_CACHE": os.path.join(SCRATCH, "cache"), "XDG_CONFIG_HOME": os.path.join(SCRATCH, "config"), "LANG": "en_US.UTF-8", }) os.environ.pop("LC_ALL", None) os.environ.pop("LC_MESSAGES", None) sys.path.insert(0, os.path.join(FILES, "python"))