Пример #1
0
    def dispatch_logging_event(self, logging_event):
        """
        Send `logging_event` to all configured loggers.

        Uses the instance management code from parent class
        :class:`~common.abstract_service_manager.AbstractServiceManager`
        to find and send the logging event passed in as an argument to
        each logger configured in the settings file.  Valid logging
        events are defined in module
        :mod:`~channels.logging.logging_events`.

        In normal operation, this method will be called automatically
        in the system by the
        :class:`~channels.channel_publisher.ChannelPublisher`, and it
        should not be necessary to use it directly.

        """
        if not isinstance(logging_event, LoggingEventBase):
            raise TypeError, "LoggingManager: logging_event TypeError"

        for name in AbstractServiceManager.instance_list(self):
            logger_instance = AbstractServiceManager.instance_get(self, name)
            try:
                logger_instance.log_event(logging_event)
            except Exception, e:
                self.__tracer.error("exception during log_event dispatch: %s",
                                    str(e))
                self.__tracer.debug(traceback.format_exc())
Пример #2
0
    def dispatch_logging_event(self, logging_event):
        """
        Send `logging_event` to all configured loggers.

        Uses the instance management code from parent class
        :class:`~common.abstract_service_manager.AbstractServiceManager`
        to find and send the logging event passed in as an argument to
        each logger configured in the settings file.  Valid logging
        events are defined in module
        :mod:`~channels.logging.logging_events`.

        In normal operation, this method will be called automatically
        in the system by the
        :class:`~channels.channel_publisher.ChannelPublisher`, and it
        should not be necessary to use it directly.

        """
        if not isinstance(logging_event, LoggingEventBase):
            raise TypeError, "LoggingManager: logging_event TypeError"

        for name in AbstractServiceManager.instance_list(self):
            logger_instance = AbstractServiceManager.instance_get(self, name)
            try:
                logger_instance.log_event(logging_event)
            except Exception, e:
                self.__tracer.error("exception during log_event dispatch: %s",
                                    str(e))
                self.__tracer.debug(traceback.format_exc())
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("presentation_manager", self)

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services,
                                        ('presentations',))
Пример #4
0
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("presentation_manager", self)

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services,
                                        ('presentations', ))
Пример #5
0
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("logging_manager", self)

        from core.tracing import get_tracer
        self.__tracer = get_tracer('LoggingManager')

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services, ('loggers',))
Пример #6
0
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("logging_manager", self)

        from core.tracing import get_tracer
        self.__tracer = get_tracer('LoggingManager')

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services, ('loggers', ))
    def instance_setting_set(self, instancename, settingname, settingvalue):
        """\
            Set a setting on a given instance name, the setting will go
            into the instance's pending settings registry.
        """
	return AbstractServiceManager.instance_setting_set(self,
                                        instancename,
                                        settingname,
                                        settingvalue)
    def driver_load(self, name):
        """\
        Loads a presentation driver class dynamically.

        If the driver has not been loaded previously, an unconfigured
        instance of the driver will be created and managed by the
        PresentationManager.  If the driver has already been loaded
        nothing will be done.  In either case, this function will
        return True.

        If the presentation driver cannot be loaded for any reason, an
        exception will be raised.
        """
	return AbstractServiceManager.service_load(self, name)
Пример #9
0
    def driver_load(self, name):
        """
        Loads a driver dynamically.

        If the driver has not been loaded previously, an unconfigured
        instance of the driver will be created and managed by the
        DeviceDriverManager. If the driver has already been loaded
        nothing will be done. In either case, this function will
        return True. If the driver cannot be loaded for any reason, an
        exception will be raised.
        
        """

        return AbstractServiceManager.service_load(self, name)
 def driver_get(self, name):
     
     return AbstractServiceManager.instance_get(self, name)
 def instance_settings_get(self, instancename):
     """Get the settings of a given class instance."""
     return AbstractServiceManager.instance_settings_get(self, instancename)
    def instance_list(self):
	return AbstractServiceManager.instance_list(self)
    def instance_new(self, classname, instancename):
        """Create a new instance of a loaded driver class."""
	return AbstractServiceManager.instance_new(self,
                                        classname, instancename)
    def instance_get(self, instancename):
        """Internal method to find a given driver instance."""
	return AbstractServiceManager.instance_get(self, instancename)
    def _instance_exists(self, instancename):
	return AbstractServiceManager._instance_exists(self, instancename)
    def instance_stop(self, instancename):
	return AbstractServiceManager.instance_stop(self, instancename)
    def instance_settings_apply(self, instancename):
        """Apply all pending settings on a given instance."""
	return AbstractServiceManager.instance_settings_apply(self,
                                        instancename)
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("device_driver_manager", self)

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services, ('devices',))
Пример #19
0
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("device_driver_manager", self)

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services, ('devices', ))