[library-web] [mallard] add some timestamp checking to avoid rebuilding mallard pages



commit 29e1622f49e88f47f366b421e9c31bff493d30dc
Author: Frédéric Péters <fpeters 0d be>
Date:   Sun Dec 5 12:19:45 2010 +0100

    [mallard] add some timestamp checking to avoid rebuilding mallard pages

 src/modtypes/mallard.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 1a72aa2..7aee011 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -224,7 +224,6 @@ class MallardModule(DocModule):
                 lang_dirname = os.path.join(ext_dirname, self.dirname, 'C')
             else:
                 lang_dirname = os.path.join(ext_dirname, self.dirname, lang)
-
             mallard_cache = MallardCache()
             for doc_page in doc_pages:
                 xml_file = os.path.join(lang_dirname, doc_page)
@@ -237,6 +236,14 @@ class MallardModule(DocModule):
             temporary = tempfile.NamedTemporaryFile()
             mallard_cache.dump(temporary.name)
 
+            html_index_file = os.path.join(web_output_dir, 'index.html.%s' % lang)
+            if not app.rebuild_all and (
+                    app.rebuild_language is None or
+                    lang != app.rebuild_language) and os.path.exists(html_index_file):
+                mtime = os.stat(html_index_file)[stat.ST_MTIME]
+                if mtime > max(self.mtime_tarball, self.mtime_xslt_files):
+                    continue
+
             for doc_page in doc_pages:
                 xml_file = os.path.join(lang_dirname, doc_page)
                 filename = os.path.splitext(doc_page)[0] + '.html.' + lang



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