Exemplo n.º 1
0
    def __init__(self, config, memento, file_callback, exception_callback):
        if not isinstance(config, dict):
            raise TypeError("Config object must be a dict")

        directory = config.get('directory')
        pattern = config.get('pattern')

        log.debug("Start directory poller path: %s, pattern: %s", directory, pattern)
        self.callback = file_callback
        self.last_file_completed = memento
        DirectoryPoller.__init__(self,
                                 directory,
                                 pattern,
                                 self.on_new_files,
                                 exception_callback,
                                 config.get('frequency', 1))
Exemplo n.º 2
0
 def __init__(self, config, memento, file_callback, exception_callback):
     self.callback = file_callback
     self.last_file_completed = memento
     DirectoryPoller.__init__(self, config['directory'], config['pattern'], self.on_new_files,
                              exception_callback, get_safe(config, 'frequency', 300))
Exemplo n.º 3
0
 def __init__(self, config, memento, file_callback, exception_callback):
     self.callback = file_callback
     self.last_file_completed = memento
     DirectoryPoller.__init__(self, config['directory'], config['pattern'],
                              self.on_new_files, exception_callback,
                              get_safe(config, 'frequency', 300))