source: ReferenceDesigns/w3_802.11/python/wlan_exp/docs/source/conf.py

Last change on this file was 6320, checked in by chunter, 5 years ago

1.8.0 release wlan-exp

File size: 12.3 KB
Line 
1# -*- coding: utf-8 -*-
2#
3# mango_wlan_exp documentation build configuration file, created by
4# sphinx-quickstart on Fri Apr  4 11:27:32 2014.
5#
6# This file is execfile()d with the current directory set to its
7# containing dir.
8#
9# Note that not all possible configuration values are present in this
10# autogenerated file.
11#
12# All configuration values have a default; values that are commented out
13# serve to show the default.
14
15# os.path.abspath returns 'docs/source/' directory
16import os
17import sys
18p = sys.path
19sys.path.insert(1, os.path.abspath('../../..')) # add local wlan_exp to start of path
20
21import wlan_exp
22print('\n**********************\nImported wlan_exp from:\n  {0}'.format(wlan_exp.__file__))
23
24import wlan_exp.version as wlan_exp_version
25
26def gen_log_entry_types_docs(gen=True):
27    RST_HDR_FILE = os.path.abspath('./log_entry_types.rst_header')
28    RST_FILE_OUT = os.path.abspath('./log_entry_types.rst')
29
30    # Check whether the entry_types.py file has been modified
31    #  since the docs were last built
32    import wlan_exp.log.entry_types as et
33    src_mtime = os.path.getmtime(et.__file__)
34    hdr_mtime = os.path.getmtime(RST_HDR_FILE)
35
36    doc_mtime = os.path.getmtime(RST_FILE_OUT)
37
38    if((src_mtime <= doc_mtime) and (hdr_mtime <= doc_mtime)):
39        # RST file already newer than header RST and Python source
40        print('\nUsing cached log entry docs')
41        return
42
43    fi = open(RST_HDR_FILE, 'r')
44    fo = open(RST_FILE_OUT, 'w') # overwrite, don't append
45   
46    hdr = fi.read()
47    fi.close()
48
49    fo.write(hdr + "\n")
50   
51    from wlan_exp.log.entry_types import log_entry_types as log_entry_types
52    for tid in log_entry_types.keys():
53        if(type(tid) is int and tid != 0):
54            fo.write(log_entry_types[tid].generate_entry_doc(fmt='rst'))
55
56    fo.flush()
57    fo.close()
58
59
60# Re-generate the entry type .rst file
61#  Set gen=False to disable generating entry type docs
62#  In this mode the log_entry_types.rst file will still be
63#   overwritten with the _header contents but will not have
64#   any per-type docs
65#  This mode should only be used when the entry_types.py
66#   code has problems, but you still want to generate docs
67gen_log_entry_types_docs(gen=True)
68print('**********************\n')
69
70#Some wlan_exp modules require numpy, but the Python environment
71# on the warpproject.org server doesn't have numpy (on purpose).
72# Numpy methods aren't actually called during autodoc, but a call
73# to 'import numpy' must succeed for autodoc to scan every wlan_exp
74# module successfully. Mock fixes this - see:
75# http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
76
77# The server sets an environment variable BUILDING_DOCS_ON_SERVER when it runs post-svn-commit
78#  Mock the numpy import only on the server
79if os.environ.get('BUILDING_DOCS_ON_SERVER', False):
80    try:
81        from mock import Mock as MagicMock
82
83        class Mock(MagicMock):
84            @classmethod
85            def __getattr__(cls, name):
86                return Mock()
87
88        MOCK_MODULES = ['numpy', 'pandas']
89        sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
90    except ImportError:
91        #mock wasn't installed - keep trying, will probably fail at actual numpy import
92        pass
93
94
95# If extensions (or modules to document with autodoc) are in another directory,
96# add these directories to sys.path here. If the directory is relative to the
97# documentation root, use os.path.abspath to make it absolute, like shown here.
98
99# -- General configuration ------------------------------------------------
100
101# If your documentation needs a minimal Sphinx version, state it here.
102#needs_sphinx = '1.0'
103
104# Add any Sphinx extension module names here, as strings. They can be
105# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
106# ones.
107extensions = [
108    'sphinx.ext.autodoc',
109    'sphinx.ext.todo',
110    'sphinx.ext.coverage',
111    'sphinx.ext.ifconfig',
112    'sphinx.ext.viewcode',
113    'sphinx.ext.extlinks',
114    'sphinx.ext.napoleon',
115    'sphinxcontrib.fulltoc',
116]
117
118# Add any paths that contain templates here, relative to this directory.
119templates_path = ['_templates']
120
121# The suffix of source filenames.
122source_suffix = '.rst'
123
124# The encoding of source files.
125#source_encoding = 'utf-8-sig'
126
127# The master toctree document.
128master_doc = 'index'
129
130# General information about the project.
131project = u'Mango 802.11 Experiments Framework User Guide'
132copyright = u'2019, Mango Communications, Inc.'
133author = u'Mango Communications, Inc.'
134
135# Napoleon settings
136napoleon_use_ivar = True
137napoleon_google_docstring = True
138napoleon_use_param = False
139
140# The version info for the project you're documenting, acts as replacement for
141# |version| and |release|, also used in various other places throughout the
142# built documents.
143#
144# The short X.Y version.
145version = wlan_exp_version.version_number
146# The full version, including alpha/beta/rc tags.
147release = wlan_exp_version.version
148
149# The language for content autogenerated by Sphinx. Refer to documentation
150# for a list of supported languages.
151#language = None
152
153# There are two options for replacing |today|: either, you set today to some
154# non-false value, then it is used:
155#today = ''
156# Else, today_fmt is used as the format for a strftime call.
157#today_fmt = '%B %d, %Y'
158
159# List of patterns, relative to source directory, that match files and
160# directories to ignore when looking for source files.
161exclude_patterns = []
162
163# The reST default role (used for this markup: `text`) to use for all
164# documents.
165#default_role = None
166
167# If true, '()' will be appended to :func: etc. cross-reference text.
168add_function_parentheses = True
169
170# If true, the current module name will be prepended to all description
171# unit titles (such as .. function::).
172add_module_names = False
173
174# If true, sectionauthor and moduleauthor directives will be shown in the
175# output. They are ignored by default.
176show_authors = False
177
178# The name of the Pygments (syntax highlighting) style to use.
179pygments_style = 'sphinx'
180
181# A list of ignored prefixes for module index sorting.
182#modindex_common_prefix = []
183
184# If true, keep warnings as "system message" paragraphs in the built documents.
185#keep_warnings = False
186
187autodoc_member_order = 'bysource'
188
189# Supress warnings about .rst files not mentioned in TOC
190exclude_patterns = ['globals.rst']
191
192# -- Options for HTML output ----------------------------------------------
193
194# The theme to use for HTML and HTML Help pages.  See the documentation for
195# a list of builtin themes.
196#html_theme = 'default'
197#html_theme = 'nature'
198#html_theme = 'classic'
199#html_theme = 'alabaster'
200#html_theme = 'sphinx_rtd_theme' # Methods are clearly marked, good for our method-heavy pages
201#html_theme = 'bizstyle'
202
203html_theme = 'nature'
204html_css_files = ['wlan_doc.css']
205html_style = 'wlan_doc.css'
206html_show_sphinx = False
207html_show_sourcelink = False
208html_short_title = '802.11 Experiments Framework User Guide'
209
210numfig  = True
211
212html_sidebars = {'**': ['globaltoc.html',  'searchbox.html']}
213
214# Theme options are theme-specific and customize the look and feel of a theme
215# further.  For a list of options available for each theme, see the
216# documentation.
217#html_theme_options = {}
218
219# Add any paths that contain custom themes here, relative to this directory.
220#html_theme_path = []
221
222# The name for this set of Sphinx documents.  If None, it defaults to
223# "<project> v<release> documentation".
224#html_title = None
225
226# A shorter title for the navigation bar.  Default is the same as html_title.
227#html_short_title = None
228
229# The name of an image file (relative to this directory) to place at the top
230# of the sidebar.
231#html_logo = None
232
233# The name of an image file (within the static path) to use as favicon of the
234# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
235# pixels large.
236#html_favicon = None
237
238# Add any paths that contain custom static files (such as style sheets) here,
239# relative to this directory. They are copied after the builtin static files,
240# so a file named "default.css" will overwrite the builtin "default.css".
241html_static_path = ['_static']
242
243# Add any extra paths that contain custom files (such as robots.txt or
244# .htaccess) here, relative to this directory. These files are copied
245# directly to the root of the documentation.
246#html_extra_path = []
247
248# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
249# using the given strftime format.
250#html_last_updated_fmt = '%b %d, %Y'
251
252# If true, SmartyPants will be used to convert quotes and dashes to
253# typographically correct entities.
254#html_use_smartypants = True
255
256# Custom sidebar templates, maps document names to template names.
257#html_sidebars = {}
258
259# Additional templates that should be rendered to pages, maps page names to
260# template names.
261#html_additional_pages = {}
262
263# If false, no module index is generated.
264#html_domain_indices = True
265
266# If false, no index is generated.
267#html_use_index = True
268
269# If true, the index is split into individual pages for each letter.
270#html_split_index = False
271
272# If true, links to the reST sources are added to the pages.
273#html_show_sourcelink = True
274
275# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
276#html_show_sphinx = True
277
278# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
279#html_show_copyright = True
280
281# If true, an OpenSearch description file will be output, and all pages will
282# contain a <link> tag referring to it.  The value of this option must be the
283# base URL from which the finished HTML is served.
284#html_use_opensearch = ''
285
286# This is the file name suffix for HTML files (e.g. ".xhtml").
287#html_file_suffix = None
288
289# Output file base name for HTML help builder.
290htmlhelp_basename = 'wlan_exp_docs'
291
292#def setup(app):
293#    app.add_stylesheet("rtd_overrides.css")
294
295# -- Options for LaTeX output ---------------------------------------------
296
297latex_elements = {
298# The paper size ('letterpaper' or 'a4paper').
299'papersize': 'letterpaper',
300
301# The font size ('10pt', '11pt' or '12pt').
302'pointsize': '10pt',
303
304# Additional stuff for the LaTeX preamble.
305#'preamble': '',
306}
307
308# Grouping the document tree into LaTeX files. List of tuples
309# (source start file, target name, title,
310#  author, documentclass [howto, manual, or own class]).
311latex_documents = [
312  ('index', 'mango_wlan_exp_docs.tex', u'mango_wlan_exp Documentation',
313   u'Mango Communications, Inc.', 'manual'),
314]
315
316# The name of an image file (relative to this directory) to place at the top of
317# the title page.
318#latex_logo = None
319
320# For "manual" documents, if this is true, then toplevel headings are parts,
321# not chapters.
322#latex_use_parts = False
323
324# If true, show page references after internal links.
325#latex_show_pagerefs = False
326
327# If true, show URL addresses after external links.
328#latex_show_urls = False
329
330# Documents to append as an appendix to all manuals.
331#latex_appendices = []
332
333# If false, no module index is generated.
334#latex_domain_indices = True
335
336
337# -- Options for manual page output ---------------------------------------
338
339# One entry per manual page. List of tuples
340# (source start file, name, description, authors, manual section).
341man_pages = [
342    ('index', 'mango_wlan_exp', u'Mango 802.11 Reference Design Experiments Framework Documentation',
343     [u'Mango Communications, Inc.'], 1)
344]
345
346# If true, show URL addresses after external links.
347#man_show_urls = False
348
349
350# -- Options for Texinfo output -------------------------------------------
351
352# Grouping the document tree into Texinfo files. List of tuples
353# (source start file, target name, title, author,
354#  dir menu entry, description, category)
355texinfo_documents = [
356  ('index', 'mango_wlan_exp', u'Mango 802.11 Reference Design Experiments Framework Documentation',
357   u'Mango Communications, Inc.', 'mango_wlan_exp', u'Mango 802.11 Reference Design Experiments Framework Documentation',
358   'Miscellaneous'),
359]
360
361# Documents to append as an appendix to all manuals.
362#texinfo_appendices = []
363
364# If false, no module index is generated.
365#texinfo_domain_indices = True
366
367# How to display URL addresses: 'footnote', 'no', or 'inline'.
368#texinfo_show_urls = 'footnote'
369
370# If true, do not generate a @detailmenu in the "Top" node's menu.
371#texinfo_no_detailmenu = False
372
373#Check if the "doc_svn_ver.txt" file exists, written by the post-commit hook
374if os.path.exists("../doc_svn_rev.txt"):
375    try:
376        with open("../doc_svn_rev.txt", 'r') as f:
377            f_str = '-' + f.read().rstrip() #strip trailing CR-NUL
378            release += f_str
379    except (IOError, OSError):
380        pass
Note: See TracBrowser for help on using the repository browser.