[cpl-plugin-hawki] 02/03: Slightly reorg to have better structured TOC page

Ole Streicher olebole-guest at alioth.debian.org
Mon Oct 28 16:08:45 UTC 2013


This is an automated email from the git hooks/post-receive script.

olebole-guest pushed a commit to branch debian
in repository cpl-plugin-hawki.

commit e71afa766231d25c92498ece54eec59978a2ee8f
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Mon Oct 28 16:47:00 2013 +0100

    Slightly reorg to have better structured TOC page
---
 debian/create_sphinx.py |   59 +++++++++++++++++++++++++++++------------------
 1 file changed, 37 insertions(+), 22 deletions(-)

diff --git a/debian/create_sphinx.py b/debian/create_sphinx.py
index 7818ac7..b921dfd 100644
--- a/debian/create_sphinx.py
+++ b/debian/create_sphinx.py
@@ -15,11 +15,6 @@ Synopsis
 
 {synopsis}
 
-Version
--------
-
-Current version: **{recipe}-{version}**.
-
 Description
 -----------
 
@@ -69,8 +64,8 @@ parameter `param`, as shown in the following example:
 Bug reports
 -----------
 
-Please report any problems to {email}. Alternatively, you may send a 
-report to the ESO User Support Department <usd-help at eso.org>.
+Please report any problems to `{author} <{email}>`_. Alternatively, you may 
+send a report to the `ESO User Support Department <usd-help at eso.org>`_.
 
 Copyright
 ---------
@@ -87,10 +82,10 @@ par_template = '''.. py:attribute:: {recipe}.param.{par}
 
 fname_template ="{recipe}.rst"
 
-index_template = '''.. title:: The {pipeline} pipeline
+index_template = '''.. title:: Overview
 
-The {PIPELINE} pipeline
-#######################
+The {PIPELINE} {version} pipeline
+###################################
 
 These pages describe the python interface for the {PIPELINE} pipeline recipes.
 
@@ -115,9 +110,9 @@ Bug reports
 ===========
 
 If you experience an unexpected behavior of any component of the {PIPELINE}
-pipeline recipes package, please, first verify that you are using one of the
-above mentioned supported platforms and refer to the list of known problems
-and limitations in the pipeline manual of the current {PIPELINE} pipeline release.
+pipeline recipes package, please, first refer to the list of known problems
+and limitations in the pipeline manual of the current {PIPELINE} pipeline
+release.
 
 For any other issues or requests, please, send a report to the `ESO User
 Support Department <usd-help at eso.org>`_, describing:
@@ -130,13 +125,20 @@ Support Department <usd-help at eso.org>`_, describing:
 '''
 
 conf_template = '''project = u'{PIPELINE} pipeline'
+version = '{version}'
+release = '{version}'
+master_doc = 'index'
 show_authors = True
+html_theme = 'sphinxdoc'
 '''
 
 pipeline = sys.argv[1]
 
 cpl.Recipe.path = "recipes"
 recipes = [ cpl.Recipe(name) for name, version in cpl.Recipe.list() ]
+oca = file(os.path.join("calib", "gasgano", "config", pipeline + ".oca")).read()
+recipes_oca = [recipe for recipe in recipes if recipe.__name__ in oca]
+recipes_x = [recipe for recipe in recipes if not recipe.__name__ in oca]
 
 def par(recipe, template, delimiter = "", count = None):
     return delimiter.join(template.format(
@@ -194,29 +196,42 @@ def rstpage(recipe, template):
     )
 
 
-for recipe in recipes:
+for recipe in recipes_oca + recipes_x:
     f = open(os.path.join("sphinx",
                           fname_template.format(recipe = recipe.__name__)), "w")
     f.write(rstpage(recipe, rst_template))
     f.close()
 
-toc = "\n".join("   {recipe}".format(
-    recipe = recipe.__name__
-) for recipe in recipes)
+if len(recipes_oca) > 0 and len(recipes_x) > 0:
+    toc_recipes = "Standard recipes\n----------------\n"
 
-toc_recipes = "\n\n".join(":obj:`{recipe}`\n   {synopsis}".format(
+toc_recipes += "\n\n".join(":data:`{recipe}`\n   {synopsis}".format(
     recipe = recipe.__name__,
     synopsis = recipe.description[0]
-) for recipe in recipes)
+) for recipe in recipes_oca)
+
+if len(recipes_oca) > 0 and len(recipes_x) > 0:
+    toc_recipes += "\n\nAdditional recipes\n--------------------\n"
+
+toc_recipes += "\n\n".join(":data:`{recipe}`\n   {synopsis}".format(
+    recipe = recipe.__name__,
+    synopsis = recipe.description[0]
+) for recipe in recipes_x)
+
+toc = "\n".join("   {recipe}".format(
+    recipe = recipe.__name__
+) for recipe in recipes_oca + recipes_x)
 
-f = open(os.path.join("sphinx", "contents.rst"), "w")
+f = open(os.path.join("sphinx", "index.rst"), "w")
 f.write(index_template.format(toctree = toc,
                               recipes = toc_recipes,
                               pipeline = pipeline,
-                              PIPELINE = pipeline.upper()))
+                              PIPELINE = pipeline.upper(),
+                              version = recipes[0].__version__))
 f.close()
 
 f = open(os.path.join("sphinx", "conf.py"), "w")
-f.write(conf_template.format(PIPELINE = pipeline.upper()))
+f.write(conf_template.format(PIPELINE = pipeline.upper(),
+                             version = recipes[0].__version__))
 f.close()
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cpl-plugin-hawki.git



More information about the debian-science-commits mailing list