2 from myslice.configengine import ConfigEngine
3 from myslice.settings import TEMPLATE_DIRS
5 class ThemeView (object):
9 self.config = ConfigEngine()
10 if self.config.myslice.theme :
11 return self.config.myslice.theme
15 self.config = ConfigEngine()
16 if self.config.myslice.theme_label :
17 return self.config.myslice.theme_label
21 self.config = ConfigEngine()
22 if self.config.myslice.theme_logo :
23 return self.config.myslice.theme_logo
27 # Load a template from the theme directory if it exists
28 # else load it from the common templates dir
29 #print "THEME = ",self.theme
30 #print "TEMPLATE = ",self.template_name
31 #print "TEMPLATE_DIRS = ",TEMPLATE_DIRS
32 filename = self.theme + '_' + self.template_name
33 #print any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
34 #print (os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
35 if any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS):
38 return self.template_name