Reset to 'standard' folders

This commit is contained in:
Martin Mahner 2017-12-12 22:27:17 +01:00
parent 451b9e9ada
commit bea1aa811a

View file

@ -13,12 +13,18 @@ PROJECT_DIR, PROJECT_MODULE_NAME = os.path.split(
os.path.dirname(os.path.realpath(dpaste.__file__)) os.path.dirname(os.path.realpath(dpaste.__file__))
) )
# Set the variable root to $VIRTUALENV/var.
PYTHON_BIN = os.path.dirname(sys.executable) PYTHON_BIN = os.path.dirname(sys.executable)
if os.path.exists(os.path.join(PYTHON_BIN, 'activate_this.py')):
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var') # Assume that the presence of 'activate_this.py' in the python bin/
if not os.path.exists(VAR_ROOT): # directory means that we're running in a virtual environment. Set the
# variable root to $VIRTUALENV/var.
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
if not os.path.exists(VAR_ROOT):
os.mkdir(VAR_ROOT) os.mkdir(VAR_ROOT)
else:
# Set the variable root to the local configuration location (which is
# ignored by the repository).
VAR_ROOT = os.path.join(PROJECT_DIR, PROJECT_MODULE_NAME, 'conf', 'local')
#============================================================================== #==============================================================================
# Generic Django project settings # Generic Django project settings