| Total Complexity | 0 |
| Total Lines | 37 |
| 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 | """The qtsass Watcher is responsible for watching and recompiling sass when |
||
| 10 | it changes on the filesystem. Here we choose a Watcher implementation based on |
||
| 11 | the availability. |
||
| 12 | |||
| 13 | Qt and watchdog implementations are provided. A RuntimeError is raised if no |
||
| 14 | implementation can be imported. |
||
| 15 | """ |
||
| 16 | |||
| 17 | # yapf: disable |
||
| 18 | |||
| 19 | from __future__ import absolute_import |
||
| 20 | |||
| 21 | # Local imports |
||
| 22 | from qtsass.watchers.polling import PollingWatcher |
||
| 23 | |||
| 24 | try: |
||
| 25 | from qtsass.watchers.qt import QtWatcher |
||
| 26 | except ImportError: |
||
| 27 | QtWatcher = None |
||
| 28 | |||
| 29 | try: |
||
| 30 | from qtsass.watchers.watchdog import WatchdogWatcher |
||
| 31 | except ImportError: |
||
| 32 | WatchdogWatcher = None |
||
| 33 | |||
| 34 | # yapf: enable |
||
| 35 | |||
| 36 | Watcher = QtWatcher or WatchdogWatcher or PollingWatcher |
||
| 37 |