diff --git a/hyde/ext/plugins/sphinx.py b/hyde/ext/plugins/sphinx.py index 05d0c7f..9eba421 100644 --- a/hyde/ext/plugins/sphinx.py +++ b/hyde/ext/plugins/sphinx.py @@ -20,13 +20,17 @@ from hyde.fs import File, Folder from hyde.model import Expando from hyde.ext.plugins.meta import MetaPlugin as _MetaPlugin -import sphinx -from sphinx.builders.html import JSONHTMLBuilder -from sphinx.util.osutil import SEP - from hyde.util import getLoggerWithNullHandler logger = getLoggerWithNullHandler('hyde.ext.plugins.sphinx') +try: + import sphinx + from sphinx.builders.html import JSONHTMLBuilder + from sphinx.util.osutil import SEP +except ImportError: + logger.error("The sphinx plugin requires sphinx.") + logger.error("`pip install -U sphinx` to get it.") + raise class SphinxPlugin(Plugin): diff --git a/hyde/ext/publishers/pyfs.py b/hyde/ext/publishers/pyfs.py index 9431afb..5a9b4ff 100644 --- a/hyde/ext/publishers/pyfs.py +++ b/hyde/ext/publishers/pyfs.py @@ -21,9 +21,14 @@ from hyde.util import getLoggerWithNullHandler logger = getLoggerWithNullHandler('hyde.ext.publishers.pyfs') -from fs.osfs import OSFS -from fs.path import pathjoin -from fs.opener import fsopendir +try: + from fs.osfs import OSFS + from fs.path import pathjoin + from fs.opener import fsopendir +except ImportError: + logger.error("The PyFS publisher requires PyFilesystem v0.4 or later.") + logger.error("`pip install -U fs` to get it.") + raise