mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-09 17:57:18 +00:00
21 lines
468 B
Python
21 lines
468 B
Python
# Copyright (C) 2018 Avatao.com Innovative Learning Kft.
|
|
# All Rights Reserved. See LICENSE file for details.
|
|
|
|
from watchdog.observers import Observer
|
|
|
|
from tfw.decorators.lazy_property import lazy_property
|
|
|
|
|
|
class ObserverMixin:
|
|
@lazy_property
|
|
def observer(self):
|
|
# pylint: disable=no-self-use
|
|
return Observer()
|
|
|
|
def watch(self):
|
|
self.observer.start()
|
|
|
|
def stop(self):
|
|
self.observer.stop()
|
|
self.observer.join()
|