mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Style nits, trailing whitespace.
This commit is contained in:
parent
a2b3fd4bbe
commit
6faa8885fb
@ -10,22 +10,22 @@ class StorageBackend(object):
|
||||
"""Add a node to the StorageBackend.
|
||||
|
||||
`document` is the name of the document the node belongs to.
|
||||
|
||||
|
||||
`line` is the line in the source where the node begins.
|
||||
|
||||
`source` is the source files name.
|
||||
|
||||
|
||||
`treeloc` is for future use.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def post_build(self):
|
||||
"""Called after a build has completed. Use this to finalize the
|
||||
addition of nodes if needed.
|
||||
"""
|
||||
pass
|
||||
|
||||
def add_comment(self, parent_id, text, displayed, username,
|
||||
def add_comment(self, parent_id, text, displayed, username,
|
||||
rating, time):
|
||||
"""Called when a comment is being added."""
|
||||
raise NotImplementedError()
|
||||
@ -34,7 +34,7 @@ class StorageBackend(object):
|
||||
"""Called to retrieve all comments for a node."""
|
||||
raise NotImplementedError()
|
||||
|
||||
def add_proposal(self, parent_id, text, displayed, username,
|
||||
def add_proposal(self, parent_id, text, displayed, username,
|
||||
rating, time):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
@ -40,10 +40,10 @@ class WhooshSearch(BaseSearch):
|
||||
|
||||
def finish_indexing(self):
|
||||
self.index_writer.commit()
|
||||
|
||||
|
||||
def add_document(self, pagename, title, text):
|
||||
self.index_writer.add_document(path=unicode(pagename),
|
||||
title=title,
|
||||
title=title,
|
||||
text=text)
|
||||
|
||||
def handle_query(self, q):
|
||||
|
@ -28,7 +28,7 @@ class XapianSearch(BaseSearch):
|
||||
|
||||
def init_indexing(self, changed=[]):
|
||||
ensuredir(self.db_path)
|
||||
self.database = xapian.WritableDatabase(self.db_path,
|
||||
self.database = xapian.WritableDatabase(self.db_path,
|
||||
xapian.DB_CREATE_OR_OPEN)
|
||||
self.indexer = xapian.TermGenerator()
|
||||
stemmer = xapian.Stem("english")
|
||||
@ -37,7 +37,7 @@ class XapianSearch(BaseSearch):
|
||||
def finish_indexing(self):
|
||||
# Ensure the db lock is removed.
|
||||
del self.database
|
||||
|
||||
|
||||
def add_document(self, path, title, text):
|
||||
self.database.begin_transaction()
|
||||
# sphinx_page_path is used to easily retrieve documents by path.
|
||||
|
Loading…
Reference in New Issue
Block a user