Total Complexity | 2 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | # ----------------------------------------------------------------------------- |
||
3 | # Copyright (c) 2015 Yann Lanthony |
||
4 | # Copyright (c) 2017-2018 Spyder Project Contributors |
||
5 | # |
||
6 | # Licensed under the terms of the MIT License |
||
7 | # (See LICENSE.txt for details) |
||
8 | # ----------------------------------------------------------------------------- |
||
9 | """Source files event handler.""" |
||
10 | |||
11 | # Third party imports |
||
12 | from watchdog.events import FileSystemEventHandler |
||
13 | |||
14 | |||
15 | class SourceEventHandler(FileSystemEventHandler): |
||
16 | |||
17 | def __init__(self, source, destination, compiler): |
||
18 | super(SourceEventHandler, self).__init__() |
||
19 | self._source = source |
||
20 | self._destination = destination |
||
21 | self._compiler = compiler |
||
22 | |||
23 | def on_modified(self, event): |
||
24 | self._compiler(self._source, self._destination) |
||
25 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.