prefs is inheretable

This commit is contained in:
age 2006-08-20 18:23:35 +00:00
parent c14d5cfbd7
commit 975b2bb14a
2 changed files with 66 additions and 56 deletions

View file

@ -17,15 +17,18 @@ class CryptoBoxSite:
'''this is the motherclass of all cbx sites
put the stuff in her, that every site will need access to'''
def __init__(self):
pass
def print_foo(self):
'''a stupid demo method'''
self.cbx_inheritance_test()
print "fooooooooooooobaaaaaaaaaaaaaaaaaaaar"
class CryptoBoxSites(CryptoBox.CryptoBoxProps, CryptoBoxSite):
'''
'''
#class CryptoBoxSites(CryptoBox.CryptoBoxProps, CryptoBoxSite):
class CryptoBoxSites(CryptoBox.CryptoBox, CryptoBox.CryptoBoxProps, CryptoBoxSite):
def index(self,action="show_status",page="",weblang="",device="", type=""):
#PROPOSAL:
@ -142,7 +145,9 @@ class CryptoBoxSites(CryptoBox.CryptoBoxProps, CryptoBoxSite):
#go render stuff
cs = CryptoBoxRenderSite()
content = cs.render(TemplateDir+"/main.cs",settings,LangDir+"/"+Language+".hdf")
self.log.debug("rendering site")
content = cs.render(self.cbxPrefs["Settings"]["TemplateDir"]+"/main.cs",settings, \
self.cbxPrefs["Settings"]["LangDir"]+"/"+Language+".hdf")
return content
@ -156,18 +161,19 @@ class CryptoBoxRenderSite:
def render(self,cs_path,settings = {},hdf_path = ""):
"""
render a clearsilver template and return the result.
gets:
- path to clearsilver template
- dictionary with settings (optional)
- path to hdf dataset (optional)
"""
hdf=neo_util.HDF()
hdf = neo_util.HDF()
if hdf_path != "":
hdf.readFile(hdf_path)
for key in settings.keys():
hdf.setValue(key,str(settings[key]))
cs= neo_cs.CS(hdf)
cs = neo_cs.CS(hdf)
cs.parseFile(cs_path)
return cs.render()