LDAP support in views
[unfold.git] / portal / theme.py
1 import os
2 from myslice.configengine import ConfigEngine
3 from myslice.settings import TEMPLATE_DIRS
4
5 class ThemeView (object):
6     
7     @property
8     def theme(self):
9         self.config = ConfigEngine()
10         print self.config
11         if self.config.myslice.theme :
12             return self.config.myslice.theme
13     
14     @property
15     def template(self):
16         # Load a template from the theme directory if it exists
17         # else load it from the common templates dir
18         print "THEME 00 = ",self.theme
19         print "TEMPLATE = ",self.template_name
20         print "TEMPLATE_DIRS = ",TEMPLATE_DIRS
21         filename = self.theme + '_' + self.template_name
22         print any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
23         print (os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
24         if any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS):
25             return filename
26         else:
27             return self.template_name