[library-web/new-website-style] do not overwrite local copies of remote documents with indexes



commit 71795878ecd2173017f109573d5d3b67c7770005
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Mar 29 20:36:31 2011 +0530

    do not overwrite local copies of remote documents with indexes

 data/xslt/dev_indexes.xsl |    2 +-
 src/document.py           |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/data/xslt/dev_indexes.xsl b/data/xslt/dev_indexes.xsl
index c84a6bc..f72a795 100644
--- a/data/xslt/dev_indexes.xsl
+++ b/data/xslt/dev_indexes.xsl
@@ -263,7 +263,7 @@ $lang]"/>
 </xsl:if>
 </xsl:template>
 
-<xsl:template match="document[ path != '']" mode="modindex">
+<xsl:template match="document[ path != '' and @single != 'true']" mode="modindex">
 <xsl:param name="lang"/>
 <xsl:if test="concat('/', @channel, '/', @modulename, '/') != @path">
 <!-- don't write document index if the document is not versioned -->
diff --git a/src/document.py b/src/document.py
index a56c222..af05717 100644
--- a/src/document.py
+++ b/src/document.py
@@ -156,9 +156,10 @@ class Document:
         if self.single_page_alternative:
             doc.set('single_page_alternative', 'true')
 
-
         assert_elementtree_node(doc)
 
+        return doc
+
 
 class RemoteDocument(Document):
     '''Class for documentation files downloaded from remote servers and
@@ -252,3 +253,8 @@ class RemoteDocument(Document):
         # can be "watched" for changes
         return app.download(href)
 
+    def create_element(self, parent, language, original_language = None):
+        doc = Document.create_element(self, parent, language, original_language)
+        if not doc:
+            return
+        doc.set('single', 'true')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]