- traceback.print_exc()
-
-# find out HTTPROOT, which is different from ROOT
-# when deployed from a package
-# this code is run by collectstatic too, so we cannot
-# assume we have ./static present already
-HTTPROOT="/usr/share/unfold"
-# the place to store local data, like e.g. the sqlite db
-DATAROOT="/var/unfold"
-# if not there, then we assume it's from a devel tree
-if not os.path.isdir (os.path.join(HTTPROOT,"static")):
- HTTPROOT=ROOT
- DATAROOT=ROOT
-
-if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for unfold"%ROOT
-if not os.path.isdir(HTTPROOT): raise Exception,"Cannot find HTTPROOT %s for unfold"%HTTPROOT
+ logger.error(traceback.format_exc())
+
+
+from myslice.configengine import ConfigEngine
+
+config = ConfigEngine()
+
+import myslice.components as components
+
+# import djcelery
+# djcelery.setup_loader()
+
+### detect if we're in a build environment
+try:
+ import manifold
+ building=False
+except:
+ building=True
+
+if not config.myslice.portal_version:
+ try:
+ v = subprocess.check_output(["git", "--git-dir", ROOT + "/.git", "describe"])
+ PORTAL_VERSION = '-'.join(v.split('-')[:-1])
+ except:
+ PORTAL_VERSION = 'not using git'
+
+# DEBUG
+if config.myslice.debug :
+ DEBUG = True
+ INTERNAL_IPS = ("127.0.0.1","132.227.84.195","132.227.78.191","132.227.84.191")
+else :
+ DEBUG = False
+
+# theme
+if config.myslice.theme :
+ theme = config.myslice.theme
+else :
+ theme = None
+
+if config.myslice.theme_label :
+ theme_label = config.myslice.theme_label
+else :
+ theme_label = theme
+
+if config.myslice.theme_logo :
+ theme_logo = config.myslice.theme_logo
+else :
+ theme_logo = theme + '.png'
+
+# HTTPROOT
+if config.myslice.httproot :
+ HTTPROOT = config.myslice.httproot
+else :
+ HTTPROOT = ROOT
+
+# DATAROOT
+if config.myslice.httproot :
+ DATAROOT = config.myslice.dataroot
+else :
+ DATAROOT = ROOT
+