Пример #1
0
 def __init__(self, parent):
     """Keep a reference to the QThread parent and maintain event state"""
     ProcessEvent.__init__(self)
     ## The Qt parent
     self._parent = parent
     ## Timer used to prevents notification floods
     self._last_event_time = time.time()
Пример #2
0
    def __init__(self, holder, uri, schedule_reader, error_event):
        ProcessEvent.__init__(self)
        self._holder = holder
        self._uri = uri
        self._current_pass = None
        self._schedule_reader = schedule_reader
        self._loop = True
        self._error_event = error_event

        self._path, self._pattern = os.path.split(urlparse(self._uri).path)

        self._readers = {}
        self._fp = None
        self._receiving = False
        self._timer = None
        self.sat = None
        self.time = None
        self.current_event = None
        self._pass_end_timer = None

        if self._schedule_reader.next_pass:
            next_pass_in = (self._schedule_reader.next_pass[0]
                            - datetime.utcnow())
            if next_pass_in.seconds > 0:
                self._timer = Timer(next_pass_in.seconds + 5,
                                    self.error)
                self._timer.start()
Пример #3
0
    def __init__(self, holder, uri, schedule_reader, error_event):
        ProcessEvent.__init__(self)
        self._holder = holder
        self._uri = uri
        self._current_pass = None
        self._schedule_reader = schedule_reader
        self._loop = True
        self._error_event = error_event

        self._path, self._pattern = os.path.split(urlparse(self._uri).path)

        self._readers = {}
        self._fp = None
        self._receiving = False
        self._timer = None
        self.sat = None
        self.time = None
        self.current_event = None
        self._pass_end_timer = None

        if self._schedule_reader.next_pass:
            next_pass_in = (self._schedule_reader.next_pass[0] -
                            datetime.utcnow())
            if next_pass_in.seconds > 0:
                self._timer = Timer(next_pass_in.seconds + 5, self.error)
                self._timer.start()
 def __init__(self, pevent=None, **kwargs):
     '''
     Init signature copy from base class. Created to save some callback
     parameter in class param.
     @param pevent:
     '''
     ProcessEvent.__init__(self, pevent=pevent, **kwargs)
     self.callback = kwargs['masterCallback']
Пример #5
0
 def __init__(self, collectors, terminator, decoder, patterns):
     ProcessEvent.__init__(self)
     FileTrigger.__init__(self, collectors, terminator, decoder)
     self.input_dirs = []
     for pattern in patterns:
         self.input_dirs.append(os.path.dirname(pattern))
     self.patterns = patterns
     self.new_file = Event()
Пример #6
0
 def __init__(self, collectors, terminator, decoder, patterns):
     ProcessEvent.__init__(self)
     FileTrigger.__init__(self, collectors, terminator, decoder)
     self.input_dirs = []
     for pattern in patterns:
         self.input_dirs.append(os.path.dirname(pattern))
     self.patterns = patterns
     self.new_file = Event()
Пример #7
0
  def __init__(self, conf_info):

    self.run_status_dict = {'firecrest': False,
                            'bustard': False,
                            'gerald': False}

    self._ci = conf_info

    ProcessEvent.__init__(self)
Пример #8
0
    def __init__(self, manager):
        """
Constructor __init__(WatcherPyinotifyCallback)

:since: v1.0.0
        """

        ProcessEvent.__init__(self)

        self.manager_weakref = ref(manager)
        """
Пример #9
0
 def __init__(self, collectors, terminator, decoder, patterns,
              publish_topic=None):
     """Init the inotify trigger."""
     ProcessEvent.__init__(self)
     FileTrigger.__init__(self, collectors, terminator, decoder,
                          publish_topic=publish_topic)
     self.input_dirs = []
     for pattern in patterns:
         self.input_dirs.append(os.path.dirname(pattern))
     self.patterns = patterns
     self.new_file = Event()
Пример #10
0
 def __init__(self, dbpath, md_queue, fd_queue, condition):
    self.dbpath = dbpath
    self.recents = []
    self.recentartists = {}
    self.recentalbums = {}
    self.recentgenres = {}
    self.recentsongs = {}
    self.md_queue = md_queue
    self.fd_queue = fd_queue
    self.condition = condition
    self.cookies = {}
    ProcessEvent.__init__(self)
Пример #11
0
    def _monitor_lockfile(self):
        eh = ProcessEvent()
        events_to_watch = 0
        if self.when_user_stops_using_oled:
            eh.process_IN_CLOSE_WRITE = lambda event: self.when_user_stops_using_oled(
            )
            events_to_watch = events_to_watch | IN_CLOSE_WRITE
        if self.when_user_starts_using_oled:
            eh.process_IN_OPEN = lambda event: self.when_user_starts_using_oled(
            )
            events_to_watch = events_to_watch | IN_OPEN

        wm = WatchManager()
        wm.add_watch(self.lock_path, events_to_watch)
        notifier = Notifier(wm, eh)
        notifier.loop()
Пример #12
0
 def __init__(self, monitor, listener):
     ProcessEvent.__init__(self)
     self.listener = listener
     self.monitor = monitor
Пример #13
0
 def __init__(self, process_callback):
     self._process_callback = process_callback
     ProcessEvent.__init__(self)
Пример #14
0
 def __init__(self):
     """Maintain event state"""
     ProcessEvent.__init__(self)
     ## Takes care of Queueing events for broadcast
     self._handler = Handler()
Пример #15
0
 def __init__(self, process_callback):
     self._process_callback = process_callback
     ProcessEvent.__init__(self)
Пример #16
0
 def __init__(self, log_file_path, source_path, des_ip, des_path):
     ProcessEvent.__init__(self)  # 继承父类的初始化方法参数
     self.log_file_path = log_file_path
     self.source_path = source_path
     self.des_ip = des_ip
     self.des_path = des_path
Пример #17
0
    def __init__(self, port, mongo_url):
        ProcessEvent.__init__(self)
        self.glider_data = {}

        self.port = port
        self.mongo_url = mongo_url
Пример #18
0
 def __init__(self, command):
     ProcessEvent.__init__(self)
     self.command = command
Пример #19
0
 def __init__(self, fsmonitor):
     ProcessEvent.__init__(self)
     self.fsmonitor_ref = fsmonitor
Пример #20
0
 def __init__(self, messenger, *args, **kwargs):
     ProcessEvent.__init__(self, *args, **kwargs)
     self.messenger = messenger
Пример #21
0
 def __init__(self, set_color):
     ProcessEvent.__init__(self)
     self.set_color = set_color
Пример #22
0
 def __init__(self):
     ProcessEvent(self)
     self.timer = None
Пример #23
0
    def __init__(self, port=8008):
        ProcessEvent.__init__(self)
        self.glider_data = {}

        self.port = port
Пример #24
0
 def __init__(self):
     """Maintain event state"""
     ProcessEvent.__init__(self)
     ## Takes care of Queueing events for broadcast
     self._handler = Handler()
Пример #25
0
 def __init__(self, dbpath, queues, condition):
     SubtreeListener.__init__(self, dbpath, queues, condition)
     ProcessEvent.__init__(self)
Пример #26
0
 def __init__(self, fsmonitor):
     ProcessEvent.__init__(self)
     self.fsmonitor_ref = fsmonitor
Пример #27
0
 def __init__(self, dbpath, queues, condition):
     SubtreeListener.__init__(self, dbpath, queues, condition)
     ProcessEvent.__init__(self)