[library-web] support modules using new documentation build system with docbook files



commit c5c7c263306842f57a240dd5a382a1641d9c4f5b
Author: FrÃdÃric PÃters <fpeters 0d be>
Date:   Mon Apr 16 14:44:22 2012 +0200

    support modules using new documentation build system with docbook files

 src/lgo.py                   |    8 ++++++--
 src/modtypes/gnomedocbook.py |   14 ++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/src/lgo.py b/src/lgo.py
index 4239be2..c7e90b5 100755
--- a/src/lgo.py
+++ b/src/lgo.py
@@ -501,8 +501,12 @@ class Lgo(App):
                 # merge lines continued with \
                 makefile_am = re.sub(r'\\\s*\n', r' ', makefile_am)
                 if 'HELP_ID' in makefile_am and '@YELP_HELP_RULES@' in makefile_am:
-                    logging.debug('found usage of mallard (via YELP_HELP_RULES) in %s' % tarinfo.name)
-                    doc = MallardModule.create_from_tar(tar, tarinfo, makefile_am, nightly)
+                    if '.page' in makefile_am:
+                        logging.debug('found usage of mallard (via YELP_HELP_RULES) in %s' % tarinfo.name)
+                        doc = MallardModule.create_from_tar(tar, tarinfo, makefile_am, nightly)
+                    else:
+                        logging.debug('found usage of docbook (via YELP_HELP_RULES) in %s' % tarinfo.name)
+                        doc = GnomeDocbookModule.create_from_tar(tar, tarinfo, makefile_am, nightly)
                 elif 'DOC_ID' in makefile_am and regex_gdu.findall(makefile_am):
                     logging.debug('found usage of mallard in %s' % tarinfo.name)
                     doc = MallardModule.create_from_tar(tar, tarinfo, makefile_am, nightly)
diff --git a/src/modtypes/gnomedocbook.py b/src/modtypes/gnomedocbook.py
index ae12c89..f6d4413 100644
--- a/src/modtypes/gnomedocbook.py
+++ b/src/modtypes/gnomedocbook.py
@@ -83,7 +83,7 @@ class GnomeDocbookModule(DocModule):
         ext_dirname = os.path.join(app.config.private_dir, 'extracts')
 
         try:
-            doc_linguas = re.findall(r'DOC_LINGUAS\s+=[\t ](.*)',
+            doc_linguas = re.findall(r'(?:DOC_LINGUAS|HELP_LINGUAS)\s+=[\t ](.*)',
                     self.makefile_am)[0].split()
             if not 'en' in doc_linguas:
                 doc_linguas.append('en')
@@ -93,7 +93,7 @@ class GnomeDocbookModule(DocModule):
             doc_linguas = ['en']
 
         try:
-            doc_figures = re.findall('DOC_FIGURES\s+=\s+(.*)',
+            doc_figures = re.findall(r'(?:DOC_FIGURES|HELP_FIGURES)\s+=\s+(.*)',
                     self.makefile_am)[0].split()
             figures_dirname = os.path.join(ext_dirname, self.dirname, 'C')
             for doc_figure in doc_figures:
@@ -161,11 +161,13 @@ class GnomeDocbookModule(DocModule):
             else:
                 lang_dirname = os.path.join(ext_dirname, self.dirname, lang)
 
-            xml_file = os.path.join(lang_dirname, doc_module + '.xml')
+            xml_file = os.path.join(lang_dirname, 'index.docbook')
             if not os.path.exists(xml_file):
-                # the document had a translation available in a previous
-                # version, and it got removed
-                continue
+                xml_file = os.path.join(lang_dirname, doc_module + '.xml')
+                if not os.path.exists(xml_file):
+                    # the document had a translation available in a previous
+                    # version, and it got removed
+                    continue
 
             xml_index_file = os.path.join(web_output_dir, 'index.xml.%s' % lang)
             skip_html_files = False



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