2006-08-24 02:06:19 +02:00
|
|
|
class CryptoBoxWebserverSettings:
|
|
|
|
'''this is the motherclass of all cbx site settings
|
|
|
|
|
|
|
|
put the stuff in here, that every site will need access to'''
|
|
|
|
|
|
|
|
def setSettings(self, website):
|
2006-08-24 16:41:11 +02:00
|
|
|
'''fills a dictionary with values from the configfile
|
2006-08-24 02:06:19 +02:00
|
|
|
|
2006-08-24 16:41:11 +02:00
|
|
|
There may also be set some useful standards here.'''
|
2006-08-24 02:06:19 +02:00
|
|
|
website.settings={}
|
2006-08-30 21:56:37 +02:00
|
|
|
#TODO: this is nessessary since the last config split in different sections
|
|
|
|
## put all found WebSettings values in the dictionary
|
2006-09-05 17:03:16 +02:00
|
|
|
## RFC: arbitrarily importing all available keys does not sound very secure [l]
|
|
|
|
## RFC: settings with the same names in different sections (Log, Main, ...) will collide silently - right? [l]
|
2006-08-30 21:56:37 +02:00
|
|
|
for key in self.cbxPrefs["WebSettings"].keys():
|
|
|
|
website.settings["Settings."+key] = self.cbxPrefs["WebSettings"][key]
|
2006-08-24 16:41:11 +02:00
|
|
|
## also all Log values
|
|
|
|
for key in self.cbxPrefs["Log"].keys():
|
|
|
|
website.settings["Log."+key] = self.cbxPrefs["Log"][key]
|
2006-08-30 21:56:37 +02:00
|
|
|
## also Main
|
|
|
|
for key in self.cbxPrefs["Main"].keys():
|
|
|
|
website.settings["Settings."+key] = self.cbxPrefs["Main"][key]
|
|
|
|
## Locations dito
|
|
|
|
for key in self.cbxPrefs["Locations"].keys():
|
|
|
|
website.settings["Settings."+key] = self.cbxPrefs["Locations"][key]
|
2006-08-24 11:02:10 +02:00
|
|
|
|
2006-08-30 21:56:37 +02:00
|
|
|
## put available languages also in the dictionary
|
|
|
|
website.settings["Settings.AvailableLanguages"] = self.getAvailableLanguages()
|
|
|
|
website.settings["Settings.AvailableDocLanguages"] = self.getAvailableDocLanguages()
|
2006-08-24 02:06:19 +02:00
|
|
|
#self.log.info(self.settings)
|
|
|
|
|
|
|
|
|
|
|
|
def print_foo(self):
|
|
|
|
'''a stupid demo method
|
|
|
|
|
|
|
|
if there are methods necessary for more than one site,
|
|
|
|
put them in here like this stupid demo'''
|
|
|
|
self.log.info("'print_foo' was called by some site and triggerd an inheritated method")
|
|
|
|
self.cbx_inheritance_test("fooooooooooooobaaaaaaaaaaaaaaaaaaaar")
|
|
|
|
|