[library-web] [mallard] expand doc_figures variable
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web] [mallard] expand doc_figures variable
- Date: Sun, 27 Mar 2011 15:39:00 +0000 (UTC)
commit 6c18a370e013007b7772f200c0d6991188465631
Author: Frédéric Péters <fpeters 0d be>
Date: Sun Mar 27 21:08:13 2011 +0530
[mallard] expand doc_figures variable
src/modtypes/mallard.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 1ba348c..96fc21e 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -164,6 +164,19 @@ class MallardModule(DocModule):
def __str__(self):
return 'mallard module at %s' % self.dirname
+ def expand_doc_figures(self, doc_figures):
+ for figure in doc_figures[:]:
+ if figure == '$(NULL)': # common idiom
+ doc_figures.remove(figure)
+ continue
+
+ if figure.startswith('$'): # $(blah)
+ doc_figures.remove(figure)
+ var_name = figure[2:-1]
+ var_content = re.findall('%s\s+=\s+(.*)' % var_name,
+ self.makefile_am)[0].split()
+ doc_figures.extend(var_content)
+
def process(self):
doc_module = self.modulename
ext_dirname = os.path.join(app.config.private_dir, 'extracts')
@@ -185,6 +198,7 @@ class MallardModule(DocModule):
doc_figures = re.findall('DOC_FIGURES\s+=\s+(.*)',
self.makefile_am)[0].split()
figures_dirname = os.path.join(ext_dirname, self.dirname, 'C')
+ self.expand_doc_figures(doc_figures)
for doc_figure in doc_figures:
if not os.path.exists(os.path.join(figures_dirname, doc_figure)):
logging.warning('figure (%s) listed but not present, going to autodiscover' % \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]