Beispiel #1
0
    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
Beispiel #2
0
 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()
Beispiel #3
0
 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()
Beispiel #4
0
 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()
Beispiel #5
0
 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()
Beispiel #6
0
    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
Beispiel #7
0
 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"))
Beispiel #8
0
 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)
Beispiel #9
0
 def __init__(self, context):
     Controller.__init__(self, context, __file__)
Beispiel #10
0
 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)
Beispiel #11
0
 def __init__(self, context):
     Controller.__init__(self, context, __file__)