[library-web] [mallard] don't fail on missing translated .pages, just skip the language



commit 2f7b2f10d7f02cb338d0afa8b08ea7926ee724b1
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Jun 8 14:06:54 2010 +0200

    [mallard] don't fail on missing translated .pages, just skip the language

 src/modtypes/mallard.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 8f989f4..1b48d22 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -225,6 +225,9 @@ class MallardModule(DocModule):
             mallard_cache = MallardCache()
             for doc_page in doc_pages:
                 xml_file = os.path.join(lang_dirname, doc_page)
+                if not os.path.exists(xml_file):
+                    doc.languages.remove(lang)
+                    continue
                 mallard_cache.add_page(xml_file)
             temporary = tempfile.NamedTemporaryFile()
             mallard_cache.dump(temporary.name)



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