2
# -*- coding: utf-8 -*-
4
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
5
# Copyright 2012 Google, Inc.
7
# Licensed under the Apache License, Version 2.0 (the "License");
8
# you may not use this file except in compliance with the License.
9
# You may obtain a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS,
15
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
# See the License for the specific language governing permissions and
17
# limitations under the License.
20
from __future__ import with_statement
22
raise ImportError("Not implemented yet.")
24
from watchdog.utils import platform
26
if platform.is_windows():
29
from watchdog.observers.api import (
32
DEFAULT_OBSERVER_TIMEOUT,
33
DEFAULT_EMITTER_TIMEOUT
36
class WindowsApiAsyncEmitter(EventEmitter):
39
Platform-independent emitter that polls a directory to detect file
43
def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
44
EventEmitter.__init__(self, event_queue, watch, timeout)
45
self._lock = threading.Lock()
47
def queue_events(self, timeout):
51
class WindowsApiAsyncObserver(BaseObserver):
54
Observer thread that schedules watching directories and dispatches
55
calls to event handlers.
58
def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
59
BaseObserver.__init__(self, emitter_class=WindowsApiAsyncEmitter,