def __init__(self, context, controllerName, configPath=""): Controller.__init__(self, context, __file__) configParser = ConfigParser() configFilename = configPath if (not exists(configPath)) and exists( getenv("HOME") + "/" + controllerName + "/etc/cherrypy.conf"): configFilename = getenv( "HOME") + "/" + controllerName + "/etc/cherrypy.conf" elif (not exists(configPath)) and getRoot(controllerName) and exists( getRoot(controllerName) + "/etc/cherrypy.conf"): configFilename = getRoot(controllerName) + "/etc/cherrypy.conf" elif exists(configPath + "/etc/cherrypy.conf"): configFilename = configPath + "/etc/cherrypy.conf" elif exists(configPath): configFilename = configPath else: raise "File not found %s" % configFilename print "****************" + configFilename try: configParser.read(configFilename) except: print "Cannot read configFilename." self.config = configParser._sections print self.config
def __init__(self, context=""): """Constructor""" self.masthead = None self.footer = None self.baseUrl = None try: Controller.__init__(self, context, __file__) except: raise traceback.format_exc()
def __init__(self, context): """ Init the controller """ Controller.__init__(self, context, __file__) # get logger from context globals.logger = self.context.Logger() # connect to DB sqlManager.initBasicConnection()
def __init__(self,context=""): """Constructor""" self.masthead = None self.footer = None self.baseUrl = None try: Controller.__init__ (self, context, __file__) except: raise traceback.format_exc()
def __init__ (self, context, controllerName, configPath=""): Controller.__init__ (self, context, __file__) configParser = ConfigParser () configFilename = configPath if (not exists (configPath)) and exists (getenv ("HOME") +"/" + controllerName + "/etc/cherrypy.conf"): configFilename = getenv ("HOME") +"/" + controllerName + "/etc/cherrypy.conf" elif (not exists (configPath)) and getRoot (controllerName) and exists (getRoot (controllerName) + "/etc/cherrypy.conf"): configFilename = getRoot (controllerName) + "/etc/cherrypy.conf" elif exists (configPath + "/etc/cherrypy.conf"): configFilename = configPath + "/etc/cherrypy.conf" elif exists (configPath): configFilename = configPath else: raise "File not found %s" % configFilename print "****************" + configFilename try: configParser.read (configFilename) except: print "Cannot read configFilename." self.config = configParser._sections print self.config
def __init__ (self, context): self.context = context Controller.__init__ (self, context, __file__) self.security_api = SecurityDBApi (context) self.context.addService (self.security_api) self.context.addService (Logger ("SECURITY_MODULE_CONTROLLER"))
def __init__(self, context): Controller.__init__(self, context, __file__) # BAD!!!!! Should really use the context for this kind of stuff. self.__yuiDir = os.environ["YUI_ROOT"] self.__cache = YUICache(self.__yuiDir)
def __init__(self, context): Controller.__init__(self, context, __file__)