From a52fd809bf0eecefc1b5aba3c05d6d56a1f66538 Mon Sep 17 00:00:00 2001 From: Jacob Mason Date: Sat, 14 Aug 2010 17:59:31 -0500 Subject: [PATCH] remove line column from node table --- sphinx/websupport/storage/__init__.py | 6 +----- sphinx/websupport/storage/db.py | 4 +--- sphinx/websupport/storage/sqlalchemystorage.py | 4 ++-- sphinx/writers/websupport.py | 1 - 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sphinx/websupport/storage/__init__.py b/sphinx/websupport/storage/__init__.py index da815d0a3..6a5ff49b1 100644 --- a/sphinx/websupport/storage/__init__.py +++ b/sphinx/websupport/storage/__init__.py @@ -16,15 +16,11 @@ class StorageBackend(object): """ pass - def add_node(self, id, document, line, source): + def add_node(self, id, document, source): """Add a node to the StorageBackend. :param id: a unique id for the comment. - :param document: the name of the document the node belongs to. - - :param line: the line in the source where the node begins. - :param source: the source files name. """ raise NotImplementedError() diff --git a/sphinx/websupport/storage/db.py b/sphinx/websupport/storage/db.py index 54b16f225..be81a3334 100644 --- a/sphinx/websupport/storage/db.py +++ b/sphinx/websupport/storage/db.py @@ -31,7 +31,6 @@ class Node(Base): id = Column(String(32), primary_key=True) document = Column(String(256), nullable=False) - line = Column(Integer) source = Column(Text, nullable=False) def nested_comments(self, username, moderator): @@ -94,10 +93,9 @@ class Node(Base): return comments - def __init__(self, id, document, line, source): + def __init__(self, id, document, source): self.id = id self.document = document - self.line = line self.source = source class Comment(Base): diff --git a/sphinx/websupport/storage/sqlalchemystorage.py b/sphinx/websupport/storage/sqlalchemystorage.py index d1683f603..174bef6e5 100644 --- a/sphinx/websupport/storage/sqlalchemystorage.py +++ b/sphinx/websupport/storage/sqlalchemystorage.py @@ -33,8 +33,8 @@ class SQLAlchemyStorage(StorageBackend): def pre_build(self): self.build_session = Session() - def add_node(self, id, document, line, source): - node = Node(id, document, line, source) + def add_node(self, id, document, source): + node = Node(id, document, source) self.build_session.add(node) self.build_session.flush() return node diff --git a/sphinx/writers/websupport.py b/sphinx/writers/websupport.py index c3d989b7c..6beb4b987 100644 --- a/sphinx/writers/websupport.py +++ b/sphinx/writers/websupport.py @@ -41,6 +41,5 @@ class WebSupportTranslator(HTMLTranslator): storage = self.builder.app.storage db_node_id = storage.add_node(id=node.uid, document=self.builder.cur_docname, - line=node.line, source=node.rawsource or node.astext()) return db_node_id