2011-03-08 22:32:27 +03:00
|
|
|
import atexit
|
|
|
|
import tempfile
|
|
|
|
|
|
|
|
|
|
|
|
_tmpdirs = set()
|
|
|
|
|
|
|
|
|
|
|
|
def _cleanup():
|
|
|
|
try:
|
|
|
|
import sys
|
|
|
|
import shutil
|
|
|
|
except ImportError:
|
|
|
|
return
|
|
|
|
tmp = None
|
|
|
|
try:
|
|
|
|
for tmp in _tmpdirs:
|
|
|
|
shutil.rmtree(tmp)
|
|
|
|
except Exception, exc:
|
|
|
|
sys.stderr.write("\n** shutil.rmtree(%r): %s\n" % (tmp, exc))
|
|
|
|
|
|
|
|
atexit.register(_cleanup)
|
|
|
|
|
|
|
|
|
|
|
|
def _polite_tmpdir():
|
|
|
|
tmp = tempfile.mkdtemp()
|
|
|
|
_tmpdirs.add(tmp)
|
|
|
|
return tmp
|
|
|
|
|
|
|
|
|
|
|
|
# See settings.py for documentation:
|
|
|
|
NETAPP_STORAGE = _polite_tmpdir()
|
|
|
|
ADDONS_PATH = _polite_tmpdir()
|
2011-08-09 04:13:03 +04:00
|
|
|
PERSONAS_PATH = _polite_tmpdir()
|
2011-03-08 22:32:27 +03:00
|
|
|
GUARDED_ADDONS_PATH = _polite_tmpdir()
|
|
|
|
UPLOADS_PATH = _polite_tmpdir()
|
|
|
|
MIRROR_STAGE_PATH = _polite_tmpdir()
|
2011-04-28 04:44:38 +04:00
|
|
|
TMP_PATH = _polite_tmpdir()
|
2011-04-28 21:28:48 +04:00
|
|
|
COLLECTIONS_ICON_PATH = _polite_tmpdir()
|
2011-05-26 03:44:34 +04:00
|
|
|
PACKAGER_PATH = _polite_tmpdir()
|
2011-06-28 21:37:12 +04:00
|
|
|
|
2011-08-23 01:24:19 +04:00
|
|
|
# We won't actually send an email.
|
|
|
|
SEND_REAL_EMAIL = True
|
|
|
|
|
2011-06-28 21:37:12 +04:00
|
|
|
# Turn off search engine indexing.
|
|
|
|
USE_ELASTIC = False
|
2011-08-03 01:16:19 +04:00
|
|
|
|
|
|
|
# Ensure all validation code runs in tests:
|
|
|
|
VALIDATE_ADDONS = True
|
2011-08-05 00:53:55 +04:00
|
|
|
|
|
|
|
# We want these impala tests to pass
|
|
|
|
IMPALA_EDIT = True
|