Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #1809 -- handle missing pyinotify
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jun 11, 2015
1 parent 7ef5b68 commit b3ae34d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Expand Up @@ -13,7 +13,7 @@ Bugfixes
--------

* Handle rare gettz failure (Issue #1806)
* Handle missing ws4py better in auto plugin (Issue #1803)
* Handle missing dependencies better in auto plugin (Issues #1803, #1809)
* IDNA mixing unicode/bytes in python 3 (Issue #1802)
* Cleaner splitting of metadata in onefile posts (Issue #973)
* It's markdown extra, not extras (Issue #1799)
Expand Down
11 changes: 6 additions & 5 deletions nikola/plugins/command/auto/__init__.py
Expand Up @@ -49,15 +49,16 @@
WebSocket = object
try:
import pyinotify
MASK = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY
except ImportError:
pyinotify = None
MASK = None


from nikola.plugin_categories import Command
from nikola.utils import req_missing, get_logger

LRJS_PATH = os.path.join(os.path.dirname(__file__), 'livereload.js')
MASK = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY
error_signal = signal('error')
refresh_signal = signal('refresh')

Expand Down Expand Up @@ -115,12 +116,12 @@ def _execute(self, options, args):

self.logger = get_logger('auto', self.site.loghandlers)

if WebSocket is object:
if WebSocket is object and pyinotify is None:
req_missing(['ws4py', 'pyinotify'], 'use the "auto" command')
elif WebSocket is object:
req_missing(['ws4py'], 'use the "auto" command')
return
if pyinotify is None:
elif pyinotify is None:
req_missing(['pyinotify'], 'use the "auto" command')
return

arguments = ['build']
if self.site.configuration_filename != 'conf.py':
Expand Down

0 comments on commit b3ae34d

Please sign in to comment.