Ejemplo n.º 1
0
 def _schedule(self, stream):
     if not stream.paths:
         raise ValueError("No paths to observe.")
     if stream.file_events:
         callback = FileEventCallback(stream.callback, stream.paths)
     else:
         def callback(paths, masks):
             for path, mask in zip(paths, masks):
                 stream.callback(path, mask)
     _fsevents.schedule(self, stream, callback, stream.paths)
Ejemplo n.º 2
0
 def _schedule(self, stream):
     if not stream.paths:
         raise ValueError("No paths to observe.")
     if stream.file_events:
         callback = FileEventCallback(stream.callback, stream.raw_paths)
     else:
         def callback(paths, masks):
             for path, mask in zip(paths, masks):
                 if sys.version_info[0] >= 3:
                     path = path.decode('utf-8')
                 stream.callback(path, mask)
     schedule(self, stream, callback, stream.paths)
Ejemplo n.º 3
0
    def _schedule(self, stream):
        if not stream.paths:
            raise ValueError("No paths to observe.")
        if stream.file_events:
            callback = FileEventCallback(stream.callback, stream.paths)
        else:

            def callback(paths, masks):
                for path, mask in zip(paths, masks):
                    stream.callback(path, mask)

        _fsevents.schedule(self, stream, callback, stream.paths)
Ejemplo n.º 4
0
    def _schedule(self, stream):
        if not stream.paths:
            msg = "No paths to observe."
            log.error(msg)
            raise ValueError(msg)

        if stream.file_events:
            callback = FileEventCallback(stream.callback, stream.paths)
        else:
            def callback(paths, masks):
                for path, mask in zip(paths, masks):
                    stream.callback(path, mask)
        _fsevents.schedule(self, stream, callback, stream.paths,
                 stream.raw_file_events, latency=self.latency)
Ejemplo n.º 5
0
    def _schedule(self, stream):
        if not stream.paths:
            raise ValueError("No paths to observe.")
        if stream.file_events:
            callback = FileEventCallback(stream.callback, stream.raw_paths)
        else:

            def callback(paths, masks):
                for path, mask in zip(paths, masks):
                    if sys.version_info[0] >= 3:
                        path = path.decode('utf-8')
                    stream.callback(path, mask)

        schedule(self, stream, callback, stream.paths)
Ejemplo n.º 6
0
 def _schedule(self, stream):
     if not stream.paths:
         raise ValueError("No paths to observe.")
     if stream.file_events:
         callback = FileEventCallback(stream.callback, stream.raw_paths)
     else:
         def callback(paths, masks, ids):
             for path, mask, id in zip(paths, masks, ids):
                 if sys.version_info[0] >= 3:
                     path = path.decode('utf-8')
                 if stream.ids is False:
                     stream.callback(path, mask)
                 elif stream.ids is True:
                     stream.callback(path, mask, id)
         
     schedule(self, stream, callback, stream.paths, stream.since, stream.latency, stream.cflags)
Ejemplo n.º 7
0
 def _schedule(self, stream):
     if not stream.paths:
         raise ValueError("No paths to observe.")
     if stream.file_events:
         callback = FileEventCallback(stream.callback, stream.raw_paths)
     else:
         def callback(paths, masks, ids):
             for path, mask, id in zip(paths, masks, ids):
                 if sys.version_info[0] >= 3:
                     path = path.decode('utf-8')
                 if stream.ids is False:
                     stream.callback(path, mask)
                 elif stream.ids is True:
                     stream.callback(path, mask, id)
         
     schedule(self, stream, callback, stream.paths, stream.since, stream.latency, stream.cflags)