Пример #1
0
    def __init__(self, ignore=None, debug=False):
        """
        :param ignore: A list of filename globs describing events that
                       should be ignored (i.e., not processed by any
                       object)
        :type ignore: list of strings (filename globs)
        :param debug: Produce debugging information about the events
                      received and handled.
        :type debug: bool

        .. -----
        .. autoattribute:: __priority__
        """
        Debuggable.__init__(self)
        self.debug_flag = debug

        #: A dict that records which objects handle which events.
        #: Keys are monitor handle IDs and values are objects whose
        #: ``HandleEvent`` method will be called to handle an event
        self.handles = dict()

        #: Queue of events to handle
        self.events = []

        if ignore is None:
            ignore = []
        #: List of filename globs to ignore events for.  For events
        #: that include the full path, both the full path and the bare
        #: filename will be checked against ``ignore``.
        self.ignore = ignore

        #: Whether or not the FAM has been started.  See :func:`start`.
        self.started = False
Пример #2
0
    def __init__(self, ignore=None, debug=False):
        """
        :param ignore: A list of filename globs describing events that
                       should be ignored (i.e., not processed by any
                       object)
        :type ignore: list of strings (filename globs)
        :param debug: Produce debugging information about the events
                      received and handled.
        :type debug: bool

        .. -----
        .. autoattribute:: __priority__
        """
        Debuggable.__init__(self)
        self.debug_flag = debug

        #: A dict that records which objects handle which events.
        #: Keys are monitor handle IDs and values are objects whose
        #: ``HandleEvent`` method will be called to handle an event
        self.handles = dict()

        #: Queue of events to handle
        self.events = []

        if ignore is None:
            ignore = []
        #: List of filename globs to ignore events for.  For events
        #: that include the full path, both the full path and the bare
        #: filename will be checked against ``ignore``.
        self.ignore = ignore

        #: Whether or not the FAM has been started.  See :func:`start`.
        self.started = False
Пример #3
0
    def __init__(self, core, datastore):
        Statistics.__init__(self, core, datastore)
        PullSource.__init__(self)
        Threaded.__init__(self)
        Debuggable.__init__(self)

        self.whoami = platform.node()
        self.transport = None

        core.setup.update(REPORTING_COMMON_OPTIONS)
        core.setup.reparse()

        if not HAS_SOUTH:
            msg = "Django south is required for Reporting"
            self.logger.error(msg)
            raise PluginInitError(msg)
Пример #4
0
 def __init__(self, setup):
     """Do something here"""
     clsname = self.__class__.__name__
     Debuggable.__init__(self, name=clsname)
     self.debug_log("Loading %s transport" % clsname)
     self.data = os.path.join(setup['repo'], 'Reporting', clsname)
     if not os.path.exists(self.data):
         self.logger.info("%s does not exist, creating" % self.data)
         try:
             os.makedirs(self.data)
         except OSError:
             self.logger.warning("Could not create %s: %s" %
                                 (self.data, sys.exc_info()[1]))
             self.logger.warning("The transport may not function properly")
     self.setup = setup
     self.timeout = 2
Пример #5
0
    def __init__(self, core, datastore):
        Statistics.__init__(self, core, datastore)
        PullSource.__init__(self)
        Threaded.__init__(self)
        Debuggable.__init__(self)

        self.whoami = platform.node()
        self.transport = None

        core.setup.update(REPORTING_COMMON_OPTIONS)
        core.setup.reparse()

        if not HAS_SOUTH:
            msg = "Django south is required for Reporting"
            self.logger.error(msg)
            raise PluginInitError(msg)
Пример #6
0
 def set_debug(self, debug):
     rv = Debuggable.set_debug(self, debug)
     if self.transport is not None:
         self.transport.set_debug(debug)
     return rv
Пример #7
0
 def set_debug(self, debug):
     rv = Debuggable.set_debug(self, debug)
     self.transport.set_debug(debug)
     return rv
Пример #8
0
 def set_debug(self, debug):
     rv = Debuggable.set_debug(self, debug)
     if self.transport is not None:
         self.transport.set_debug(debug)
     return rv