Browse Source

sphinx/pyfs plugins: add error messages for missing imports

main
Ryan Kelly 13 years ago
parent
commit
566c1f103e
2 changed files with 16 additions and 7 deletions
  1. +8
    -4
      hyde/ext/plugins/sphinx.py
  2. +8
    -3
      hyde/ext/publishers/pyfs.py

+ 8
- 4
hyde/ext/plugins/sphinx.py View File

@@ -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):


+ 8
- 3
hyde/ext/publishers/pyfs.py View File

@@ -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





Loading…
Cancel
Save