#
# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-import sys, os, sphinx
-import sphinx_rtd_theme
+import sys, os, time, sphinx, logging
+
+# -- ADAO version information --------------------------------------------------
try:
sys.path.append(os.path.abspath("../../bin"))
import module_version
- print("Import du module_version de bin...")
+ logging.debug('Using "module_version" that was found from "bin"...')
except:
pass
try:
sys.path.append(os.path.abspath("../../adao/adao/daCore"))
import version as module_version
- print("Import du module_version de daCore...")
+ logging.debug('Using "module_version" that was found from "daCore"...')
except:
pass
+if "module_version" not in locals():
+ module_version = lambda : None
+ module_version.name = "ADAO"
+ module_version.year = "%s"%(time.localtime()[0],)
+ module_version.version = ""
+ logging.warning('Using fallback "module_version" because none was found')
-# -- Project information -----------------------------------------------------
+# -- Project information -------------------------------------------------------
project = u'%s'%module_version.name
author = u'Jean-Philippe ARGAUD'
doctitle = u"%s documentation"%module_version.name
docfull = u"Aiding for Data Assimilation and Optimization"
-# -- General configuration ---------------------------------------------------
+# -- General configuration -----------------------------------------------------
from distutils.version import LooseVersion #, StrictVersion
-if LooseVersion(sphinx.__version__) < LooseVersion("1.4.0"):
- extensions = [
- 'sphinx.ext.pngmath',
- 'sphinx_rtd_theme',
- ]
+__lv = LooseVersion(sphinx.__version__)
+if __lv < LooseVersion("1.4.0"):
+ extensions = ['sphinx.ext.pngmath']
else:
- extensions = [
- 'sphinx.ext.imgmath',
- 'sphinx_rtd_theme',
- ]
+ extensions = ['sphinx.ext.imgmath']
+try:
+ import sphinx_rtd_theme
+ extensions += ['sphinx_rtd_theme']
+ use_rtd_theme = True
+ logging.debug('Using "sphinx_rtd_theme" that was found')
+except:
+ use_rtd_theme = False
+ logging.debug('Not using "sphinx_rtd_theme" because none was found')
#
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
language = 'en'
-exclude_patterns = ['snippets', 'scripts', 'resources', '_build', 'Thumbs.db', '.DS_Store', 'Grenier']
+exclude_patterns = [
+ 'snippets',
+ 'scripts',
+ 'resources',
+ '_build',
+ 'Thumbs.db',
+ '.DS_Store',
+ 'Grenier',
+ ]
pygments_style = None
templates_path = ['_templates']
exclude_trees = ['snippets',]
-# -- Options for HTML output -------------------------------------------------
+# -- Options for HTML output ---------------------------------------------------
-html_theme = "sphinx_rtd_theme"
-# html_theme = 'default'
-# html_theme = 'alabaster'
+if use_rtd_theme:
+ html_theme = "sphinx_rtd_theme"
+else:
+ html_theme = 'default' if __lv < LooseVersion("1.3.0") else 'classic'
+#
html_title = doctitle
html_static_path = ['_static']
html_show_sourcelink = False
-# -- Options for HTMLHelp output ---------------------------------------------
+# -- Options for HTMLHelp output -----------------------------------------------
htmlhelp_basename = 'ADAOdoc'
-# -- Options for LaTeX output ------------------------------------------------
+# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
- 'papersize': 'letterpaper',
+ 'papersize': 'a4paper',
'pointsize': '10pt',
'figure_align': 'htbp',
}
author, 'manual'),
]
-# -- Options for manual page output ------------------------------------------
+# -- Options for manual page output --------------------------------------------
man_pages = [
(master_doc, 'adao', doctitle,
[author], 1)
]
-# -- Options for Texinfo output ----------------------------------------------
+# -- Options for Texinfo output ------------------------------------------------
texinfo_documents = [
(master_doc, 'ADAO', doctitle,
author, 'ADAO', docfull,
'Miscellaneous'),
]
-# -- Options for Epub output -------------------------------------------------
+# -- Options for Epub output ---------------------------------------------------
epub_title = doctitle
epub_author = author
epub_copyright = copyright
epub_exclude_files = ['search.html']
-# -- Options for PDF output --------------------------------------------------
+# -- Options for PDF output ----------------------------------------------------
pdf_documents = [
('contents', u'ADAO', u'ADAO', author, dict(pdf_compressed = True)),
pdf_compressed = True
pdf_inline_footnotes = True
-# -- Extension configuration -------------------------------------------------
+# -- Extension configuration ---------------------------------------------------
#
# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-import sys, os, sphinx
-import sphinx_rtd_theme
+import sys, os, time, sphinx, logging
+
+# -- ADAO version information --------------------------------------------------
try:
sys.path.append(os.path.abspath("../../bin"))
import module_version
- print("Import du module_version de bin...")
+ logging.debug('Using "module_version" that was found from "bin"...')
except:
pass
try:
sys.path.append(os.path.abspath("../../adao/adao/daCore"))
import version as module_version
- print("Import du module_version de daCore...")
+ logging.debug('Using "module_version" that was found from "daCore"...')
except:
pass
+if "module_version" not in locals():
+ module_version = lambda : None
+ module_version.name = "ADAO"
+ module_version.year = "%s"%(time.localtime()[0],)
+ module_version.version = ""
+ logging.warning('Using fallback "module_version" because none was found')
-# -- Project information -----------------------------------------------------
+# -- Project information -------------------------------------------------------
project = u'%s'%module_version.name
author = u'Jean-Philippe ARGAUD'
doctitle = u"Documentation %s"%module_version.name
docfull = u"Assimilation de Données et Aide à l'Optimisation"
-# -- General configuration ---------------------------------------------------
+# -- General configuration -----------------------------------------------------
from distutils.version import LooseVersion #, StrictVersion
-if LooseVersion(sphinx.__version__) < LooseVersion("1.4.0"):
- extensions = [
- 'sphinx.ext.pngmath',
- 'sphinx_rtd_theme',
- ]
+__lv = LooseVersion(sphinx.__version__)
+if __lv < LooseVersion("1.4.0"):
+ extensions = ['sphinx.ext.pngmath']
else:
- extensions = [
- 'sphinx.ext.imgmath',
- 'sphinx_rtd_theme',
- ]
+ extensions = ['sphinx.ext.imgmath']
+try:
+ import sphinx_rtd_theme
+ extensions += ['sphinx_rtd_theme']
+ use_rtd_theme = True
+ logging.debug('Using "sphinx_rtd_theme" that was found')
+except:
+ use_rtd_theme = False
+ logging.debug('Not using "sphinx_rtd_theme" because none was found')
#
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
language = 'fr'
-exclude_patterns = ['snippets', 'scripts', 'resources', '_build', 'Thumbs.db', '.DS_Store', 'Grenier']
+exclude_patterns = [
+ 'snippets',
+ 'scripts',
+ 'resources',
+ '_build',
+ 'Thumbs.db',
+ '.DS_Store',
+ 'Grenier',
+ ]
pygments_style = None
templates_path = ['_templates']
exclude_trees = ['snippets',]
-# -- Options for HTML output -------------------------------------------------
+# -- Options for HTML output ---------------------------------------------------
-html_theme = "sphinx_rtd_theme"
-# html_theme = 'default'
-# html_theme = 'alabaster'
+if use_rtd_theme:
+ html_theme = "sphinx_rtd_theme"
+else:
+ html_theme = 'default' if __lv < LooseVersion("1.3.0") else 'classic'
+#
html_title = doctitle
html_static_path = ['_static']
html_show_sourcelink = False
-# -- Options for HTMLHelp output ---------------------------------------------
+# -- Options for HTMLHelp output -----------------------------------------------
htmlhelp_basename = 'ADAOdoc'
-# -- Options for LaTeX output ------------------------------------------------
+# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
'papersize': 'a4paper',
author, 'manual'),
]
-# -- Options for manual page output ------------------------------------------
+# -- Options for manual page output --------------------------------------------
man_pages = [
(master_doc, 'adao', doctitle,
[author], 1)
]
-# -- Options for Texinfo output ----------------------------------------------
+# -- Options for Texinfo output ------------------------------------------------
texinfo_documents = [
(master_doc, 'ADAO', doctitle,
author, 'ADAO', docfull,
'Miscellaneous'),
]
-# -- Options for Epub output -------------------------------------------------
+# -- Options for Epub output ---------------------------------------------------
epub_title = doctitle
epub_author = author
epub_copyright = copyright
epub_exclude_files = ['search.html']
-# -- Options for PDF output --------------------------------------------------
+# -- Options for PDF output ----------------------------------------------------
pdf_documents = [
('contents', u'ADAO', u'ADAO', author, dict(pdf_compressed = True)),
pdf_compressed = True
pdf_inline_footnotes = True
-# -- Extension configuration -------------------------------------------------
+# -- Extension configuration ---------------------------------------------------