diff options
-rw-r--r-- | sphinx/builders/websupport.py | 3 | ||||
-rw-r--r-- | sphinx/websupport/__init__.py | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/sphinx/builders/websupport.py b/sphinx/builders/websupport.py index 303adfe64..7970f8bd7 100644 --- a/sphinx/builders/websupport.py +++ b/sphinx/builders/websupport.py @@ -11,7 +11,6 @@ import cPickle as pickle from os import path -from cgi import escape import posixpath import shutil @@ -83,7 +82,7 @@ class WebSupportBuilder(StandaloneHTMLBuilder, VersioningBuilderMixin): return '/' + posixpath.join(self.app.staticdir, otheruri) ctx['pathto'] = pathto ctx['hasdoc'] = lambda name: name in self.env.all_docs - ctx['encoding'] = encoding = self.config.html_output_encoding + ctx['encoding'] = self.config.html_output_encoding ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw) self.add_sidebars(pagename, ctx) ctx.update(addctx) diff --git a/sphinx/websupport/__init__.py b/sphinx/websupport/__init__.py index a0a6787ae..f410e10d3 100644 --- a/sphinx/websupport/__init__.py +++ b/sphinx/websupport/__init__.py @@ -19,9 +19,9 @@ from jinja2 import Environment, FileSystemLoader from sphinx.application import Sphinx from sphinx.util.osutil import ensuredir from sphinx.util.jsonimpl import dumps as dump_json +from sphinx.websupport import errors from sphinx.websupport.search import BaseSearch, SEARCH_ADAPTERS from sphinx.websupport.storage import StorageBackend -from sphinx.websupport.errors import * class WebSupportApp(Sphinx): @@ -103,7 +103,7 @@ class WebSupport(object): It will also save node data to the database. """ if not self.srcdir: - raise SrcdirNotSpecifiedError( \ + raise errors.SrcdirNotSpecifiedError( \ 'No srcdir associated with WebSupport object') doctreedir = path.join(self.outdir, 'doctrees') app = WebSupportApp(self.srcdir, self.srcdir, @@ -158,7 +158,7 @@ class WebSupport(object): try: f = open(infilename, 'rb') except IOError: - raise DocumentNotFoundError( + raise errors.DocumentNotFoundError( 'The document "%s" could not be found' % docname) document = pickle.load(f) @@ -334,7 +334,7 @@ class WebSupport(object): :param moderator: Whether the user making the request is a moderator. """ if not moderator: - raise UserNotAuthorizedError() + raise errors.UserNotAuthorizedError() self.storage.accept_comment(comment_id) def reject_comment(self, comment_id, moderator=False): @@ -347,7 +347,7 @@ class WebSupport(object): :param moderator: Whether the user making the request is a moderator. """ if not moderator: - raise UserNotAuthorizedError() + raise errors.UserNotAuthorizedError() self.storage.reject_comment(comment_id) def _make_base_comment_options(self): |