[library-web] add configuration variable to control the wiping of stale content



commit fe38c5cb660d88160af121114e7e44306efcde40
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat Sep 6 10:48:17 2014 +0200

    add configuration variable to control the wiping of stale content

 src/config.py      |    3 ++-
 src/defaults.lgorc |    3 +++
 src/lgo.py         |    3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/config.py b/src/config.py
index 67be5ee..b3db137 100644
--- a/src/config.py
+++ b/src/config.py
@@ -37,7 +37,8 @@ _known_keys = ['ftp_gnome_org_local_copy', 'use_latest_version',
             'httxt2dbm_path', 'fast_mode', 'create_tarballs',
             'symbols_sqlite_filepath', 'nightly_tarballs_location',
             'channels', 'doc_path_template', 'indexes_xsl_file',
-            'baseref', 'use_git_for_stable_version']
+            'baseref', 'use_git_for_stable_version',
+            'wipe_stale_content']
 
 class Config:
     def __init__(self, filename=_default_lgorc):
diff --git a/src/defaults.lgorc b/src/defaults.lgorc
index 2bc07a2..0623b48 100644
--- a/src/defaults.lgorc
+++ b/src/defaults.lgorc
@@ -78,3 +78,6 @@ doc_path_template = '/%(channel)s/%(module)s/'
 
 # xsl file to use to create index.html files
 indexes_xsl_file = None
+
+# wipe documents and versions that are no longer referenced
+wipe_stale_content = True
diff --git a/src/lgo.py b/src/lgo.py
index edae60c..45bb92c 100755
--- a/src/lgo.py
+++ b/src/lgo.py
@@ -173,7 +173,8 @@ class Lgo(App):
         #self.generate_sitemap()
         self.generate_symbols_files()
         self.generate_static_pages()
-        self.remove_stale_versions()
+        if self.config.wipe_stale_content:
+            self.remove_stale_versions()
 
     def fix_modules_order(self, modules):
         for doc in modules[:]:


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