예제 #1
0
파일: context.py 프로젝트: COSHPC/heat
    def __init__(self, app, conf, **local_conf):
        # Determine the context class to use
        self.ctxcls = RequestContext
        if 'context_class' in local_conf:
            self.ctxcls = importutils.import_class(local_conf['context_class'])

        super(ContextMiddleware, self).__init__(app)
예제 #2
0
    def __init__(self, app, conf, **local_conf):
        # Determine the context class to use
        self.ctxcls = RequestContext
        if 'context_class' in local_conf:
            self.ctxcls = importutils.import_class(local_conf['context_class'])

        super(ContextMiddleware, self).__init__(app)
예제 #3
0
파일: context.py 프로젝트: realfms/heat
    def __init__(self, app, conf, **local_conf):
        cfg.CONF.register_opts(self.opts)

        # Determine the context class to use
        self.ctxcls = RequestContext
        if "context_class" in local_conf:
            self.ctxcls = importutils.import_class(local_conf["context_class"])

        super(ContextMiddleware, self).__init__(app)
예제 #4
0
파일: service.py 프로젝트: devcamcar/heat
 def __init__(self, host, binary, topic, manager,
              periodic_interval=None, *args, **kwargs):
     self.host = host
     self.binary = binary
     self.topic = topic
     self.manager_class_name = manager
     manager_class = importutils.import_class(self.manager_class_name)
     self.manager = manager_class(host=self.host, *args, **kwargs)
     self.periodic_interval = periodic_interval
     super(Service, self).__init__(*args, **kwargs)
     self.saved_args, self.saved_kwargs = args, kwargs
     self.timers = []
예제 #5
0
 def __init__(self,
              host,
              binary,
              topic,
              manager,
              periodic_interval=None,
              *args,
              **kwargs):
     self.host = host
     self.binary = binary
     self.topic = topic
     self.manager_class_name = manager
     manager_class = importutils.import_class(self.manager_class_name)
     self.manager = manager_class(host=self.host, *args, **kwargs)
     self.periodic_interval = periodic_interval
     super(Service, self).__init__(*args, **kwargs)
     self.saved_args, self.saved_kwargs = args, kwargs
     self.timers = []
예제 #6
0
파일: wsgi.py 프로젝트: abilashp/heat
    def _import_factory(self, local_conf):
        """Import an app/filter class.

        Lookup the KEY from the PasteDeploy local conf and import the
        class named there. This class can then be used as an app or
        filter factory.

        Note we support the <module>:<class> format.

        Note also that if you do e.g.

          key =
              value

        then ConfigParser returns a value with a leading newline, so
        we strip() the value before using it.
        """
        class_name = local_conf[self.KEY].replace(':', '.').strip()
        return importutils.import_class(class_name)
예제 #7
0
    def _import_factory(self, local_conf):
        """Import an app/filter class.

        Lookup the KEY from the PasteDeploy local conf and import the
        class named there. This class can then be used as an app or
        filter factory.

        Note we support the <module>:<class> format.

        Note also that if you do e.g.

          key =
              value

        then ConfigParser returns a value with a leading newline, so
        we strip() the value before using it.
        """
        class_name = local_conf[self.KEY].replace(':', '.').strip()
        return importutils.import_class(class_name)