|
18 | 18 |
|
19 | 19 | from distutils.version import LooseVersion as CheckVer |
20 | 20 |
|
21 | | -currdir = os.path.dirname(os.path.abspath(__file__)) |
22 | | -parent = pathlib.Path(currdir).parent |
23 | | -path = os.path.join(parent, "odml", "info.json") |
| 21 | +_currdir = os.path.dirname(os.path.abspath(__file__)) |
| 22 | +_parent = pathlib.Path(_currdir).parent |
| 23 | +_path = os.path.join(_parent, "odml", "info.json") |
24 | 24 |
|
25 | | -with open(path) as infofile: |
26 | | - infodict = json.load(infofile) |
| 25 | +with open(_path) as infofile: |
| 26 | + _infodict = json.load(infofile) |
27 | 27 |
|
28 | | -version_str = infodict["VERSION"] |
| 28 | +VERSION_STR = _infodict["VERSION"] |
| 29 | +COPY_RIGHT = _infodict["COPYRIGHT"] |
29 | 30 |
|
30 | 31 | # If extensions (or modules to document with autodoc) are in another directory, |
31 | 32 | # add these directories to sys.path here. If the directory is relative to the |
|
34 | 35 |
|
35 | 36 |
|
36 | 37 | class DocStringInheritor(type): |
37 | | - """A variation on |
| 38 | + """ |
| 39 | + A variation on |
38 | 40 | http://groups.google.com/group/comp.lang.python/msg/26f7b4fcb4d66c95 |
39 | 41 | by Paul McGuire |
40 | 42 | """ |
41 | 43 | def __new__(meta, name, bases, clsdict): |
42 | 44 | if not('__doc__' in clsdict and clsdict['__doc__']): |
43 | 45 | for mro_cls in (mro_cls for base in bases for mro_cls in base.mro()): |
44 | | - doc=mro_cls.__doc__ |
| 46 | + doc = mro_cls.__doc__ |
45 | 47 | if doc: |
46 | | - clsdict['__doc__']=doc |
| 48 | + clsdict['__doc__'] = doc |
47 | 49 | break |
48 | 50 | for attr, attribute in clsdict.items(): |
49 | 51 | if not attribute.__doc__: |
50 | 52 | for mro_cls in (mro_cls for base in bases for mro_cls in base.mro() |
51 | 53 | if hasattr(mro_cls, attr)): |
52 | | - doc=getattr(getattr(mro_cls,attr),'__doc__') |
| 54 | + doc = getattr(getattr(mro_cls, attr), '__doc__') |
53 | 55 | if doc: |
54 | | - attribute.__doc__=doc |
| 56 | + attribute.__doc__ = doc |
55 | 57 | break |
56 | 58 | return type.__new__(meta, name, bases, clsdict) |
57 | 59 |
|
| 60 | + |
58 | 61 | # -- General configuration ----------------------------------------------------- |
59 | 62 |
|
60 | 63 | # Add any Sphinx extension module names here, as strings. They can be extensions |
61 | 64 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
62 | | -extensions = ['sphinx.ext.autodoc'] |
| 65 | +extensions = ["sphinx.ext.autodoc", "sphinx_rtd_theme"] |
63 | 66 |
|
64 | 67 | # Add any paths that contain templates here, relative to this directory. |
65 | | -templates_path = ['_templates'] |
| 68 | +templates_path = ["_templates"] |
66 | 69 |
|
67 | 70 | # The suffix of source filenames. |
68 | | -source_suffix = '.rst' |
| 71 | +source_suffix = ".rst" |
69 | 72 |
|
70 | 73 | # The encoding of source files. |
71 | | -#source_encoding = 'utf-8' |
| 74 | +# source_encoding = 'utf-8' |
72 | 75 |
|
73 | 76 | # The master toctree document. |
74 | | -master_doc = 'index' |
| 77 | +master_doc = "index" |
75 | 78 |
|
76 | 79 | # General information about the project. |
77 | | -project = u'python-odml' |
78 | | -copyright = u'2011-2020, German Neuroinformatics Node (G-Node); based on work by Hagen Fritsch' |
| 80 | +project = "python-odml" |
| 81 | +copyright = COPY_RIGHT |
79 | 82 |
|
80 | 83 | # The version info for the project you're documenting, acts as replacement for |
81 | 84 | # |version| and |release|, also used in various other places throughout the |
82 | 85 | # built documents. |
83 | 86 | # |
84 | 87 | # The short X.Y version. |
85 | | -version = "%s.%s" % (CheckVer(version_str).version[0], CheckVer(version_str).version[1]) |
| 88 | +version = "%s.%s" % (CheckVer(VERSION_STR).version[0], CheckVer(VERSION_STR).version[1]) |
86 | 89 | # The full version, including alpha/beta/rc tags. |
87 | | -release = version_str |
| 90 | +release = VERSION_STR |
88 | 91 |
|
89 | 92 | # The language for content autogenerated by Sphinx. Refer to documentation |
90 | 93 | # for a list of supported languages. |
91 | | -#language = None |
| 94 | +# language = None |
92 | 95 |
|
93 | 96 | # There are two options for replacing |today|: either, you set today to some |
94 | 97 | # non-false value, then it is used: |
95 | | -#today = '' |
| 98 | +# today = '' |
96 | 99 | # Else, today_fmt is used as the format for a strftime call. |
97 | | -#today_fmt = '%B %d, %Y' |
| 100 | +# today_fmt = '%B %d, %Y' |
98 | 101 |
|
99 | 102 | # List of documents that shouldn't be included in the build. |
100 | | -#unused_docs = [] |
| 103 | +# unused_docs = [] |
101 | 104 |
|
102 | 105 | # List of directories, relative to source directory, that shouldn't be searched |
103 | 106 | # for source files. |
104 | | -exclude_trees = ['_build'] |
| 107 | +exclude_trees = ["_build"] |
105 | 108 |
|
106 | 109 | # The reST default role (used for this markup: `text`) to use for all documents. |
107 | | -#default_role = None |
| 110 | +# default_role = None |
108 | 111 |
|
109 | 112 | # If true, '()' will be appended to :func: etc. cross-reference text. |
110 | | -#add_function_parentheses = True |
| 113 | +# add_function_parentheses = True |
111 | 114 |
|
112 | 115 | # If true, the current module name will be prepended to all description |
113 | 116 | # unit titles (such as .. function::). |
114 | | -#add_module_names = True |
| 117 | +# add_module_names = True |
115 | 118 |
|
116 | 119 | # If true, sectionauthor and moduleauthor directives will be shown in the |
117 | 120 | # output. They are ignored by default. |
118 | | -#show_authors = False |
| 121 | +# show_authors = False |
119 | 122 |
|
120 | 123 | # The name of the Pygments (syntax highlighting) style to use. |
121 | | -pygments_style = 'sphinx' |
| 124 | +pygments_style = "sphinx" |
122 | 125 |
|
123 | 126 | # A list of ignored prefixes for module index sorting. |
124 | | -#modindex_common_prefix = [] |
| 127 | +# modindex_common_prefix = [] |
125 | 128 |
|
126 | 129 |
|
127 | 130 | # -- Options for HTML output --------------------------------------------------- |
128 | 131 |
|
129 | 132 | # The theme to use for HTML and HTML Help pages. Major themes that come with |
130 | 133 | # Sphinx are currently 'default' and 'sphinxdoc'. |
131 | | -html_theme = 'sphinxdoc' |
| 134 | +# html_theme = "sphinxdoc" |
| 135 | +html_theme = "sphinx_rtd_theme" |
132 | 136 |
|
133 | 137 | # Theme options are theme-specific and customize the look and feel of a theme |
134 | 138 | # further. For a list of options available for each theme, see the |
135 | 139 | # documentation. |
136 | | -#html_theme_options = {} |
| 140 | +# html_theme_options = {} |
137 | 141 |
|
138 | 142 | # Add any paths that contain custom themes here, relative to this directory. |
139 | | -#html_theme_path = [] |
| 143 | +# html_theme_path = [] |
140 | 144 |
|
141 | 145 | # The name for this set of Sphinx documents. If None, it defaults to |
142 | 146 | # "<project> v<release> documentation". |
143 | | -#html_title = None |
| 147 | +# html_title = None |
144 | 148 |
|
145 | 149 | # A shorter title for the navigation bar. Default is the same as html_title. |
146 | | -#html_short_title = None |
| 150 | +# html_short_title = None |
147 | 151 |
|
148 | 152 | # The name of an image file (relative to this directory) to place at the top |
149 | 153 | # of the sidebar. |
150 | | -#html_logo = None |
| 154 | +# html_logo = None |
151 | 155 |
|
152 | 156 | # The name of an image file (within the static path) to use as favicon of the |
153 | 157 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
154 | 158 | # pixels large. |
155 | | -#html_favicon = None |
| 159 | +# html_favicon = None |
156 | 160 |
|
157 | 161 | # Add any paths that contain custom static files (such as style sheets) here, |
158 | 162 | # relative to this directory. They are copied after the builtin static files, |
159 | 163 | # so a file named "default.css" will overwrite the builtin "default.css". |
160 | | -html_static_path = ['_static'] |
| 164 | +html_static_path = ["_static"] |
161 | 165 |
|
162 | 166 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
163 | 167 | # using the given strftime format. |
164 | | -#html_last_updated_fmt = '%b %d, %Y' |
| 168 | +# html_last_updated_fmt = '%b %d, %Y' |
165 | 169 |
|
166 | 170 | # If true, SmartyPants will be used to convert quotes and dashes to |
167 | 171 | # typographically correct entities. |
168 | | -#html_use_smartypants = True |
| 172 | +# html_use_smartypants = True |
169 | 173 |
|
170 | 174 | # Custom sidebar templates, maps document names to template names. |
171 | | -#html_sidebars = {} |
| 175 | +# html_sidebars = {} |
172 | 176 |
|
173 | 177 | # Additional templates that should be rendered to pages, maps page names to |
174 | 178 | # template names. |
175 | | -#html_additional_pages = {} |
| 179 | +# html_additional_pages = {} |
176 | 180 |
|
177 | 181 | # If false, no module index is generated. |
178 | | -#html_use_modindex = True |
| 182 | +# html_use_modindex = True |
179 | 183 |
|
180 | 184 | # If false, no index is generated. |
181 | | -#html_use_index = True |
| 185 | +# html_use_index = True |
182 | 186 |
|
183 | 187 | # If true, the index is split into individual pages for each letter. |
184 | | -#html_split_index = False |
| 188 | +# html_split_index = False |
185 | 189 |
|
186 | 190 | # If true, links to the reST sources are added to the pages. |
187 | | -#html_show_sourcelink = True |
| 191 | +# html_show_sourcelink = True |
188 | 192 |
|
189 | 193 | # If true, an OpenSearch description file will be output, and all pages will |
190 | 194 | # contain a <link> tag referring to it. The value of this option must be the |
191 | 195 | # base URL from which the finished HTML is served. |
192 | | -#html_use_opensearch = '' |
| 196 | +# html_use_opensearch = '' |
193 | 197 |
|
194 | 198 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). |
195 | | -#html_file_suffix = '' |
| 199 | +# html_file_suffix = '' |
196 | 200 |
|
197 | 201 | # Output file base name for HTML help builder. |
198 | | -htmlhelp_basename = 'python-odmldoc' |
| 202 | +htmlhelp_basename = "python-odmldoc" |
199 | 203 |
|
200 | 204 |
|
201 | 205 | # -- Options for LaTeX output -------------------------------------------------- |
202 | 206 |
|
203 | 207 | # The paper size ('letter' or 'a4'). |
204 | | -#latex_paper_size = 'letter' |
| 208 | +# latex_paper_size = 'letter' |
205 | 209 |
|
206 | 210 | # The font size ('10pt', '11pt' or '12pt'). |
207 | | -#latex_font_size = '10pt' |
| 211 | +# latex_font_size = '10pt' |
208 | 212 |
|
209 | 213 | # Grouping the document tree into LaTeX files. List of tuples |
210 | 214 | # (source start file, target name, title, author, documentclass [howto/manual]). |
211 | | -latex_documents = [ |
212 | | - ('index', 'python-odml.tex', u'python-odml Documentation', |
213 | | - u'Hagen Fritsch', 'manual'), |
214 | | -] |
| 215 | +latex_documents = [('index', 'python-odml.tex', u'python-odml Documentation', |
| 216 | + u'Hagen Fritsch', 'manual')] |
215 | 217 |
|
216 | 218 | # The name of an image file (relative to this directory) to place at the top of |
217 | 219 | # the title page. |
218 | | -#latex_logo = None |
| 220 | +# latex_logo = None |
219 | 221 |
|
220 | 222 | # For "manual" documents, if this is true, then toplevel headings are parts, |
221 | 223 | # not chapters. |
222 | | -#latex_use_parts = False |
| 224 | +# latex_use_parts = False |
223 | 225 |
|
224 | 226 | # Additional stuff for the LaTeX preamble. |
225 | | -#latex_preamble = '' |
| 227 | +# latex_preamble = '' |
226 | 228 |
|
227 | 229 | # Documents to append as an appendix to all manuals. |
228 | | -#latex_appendices = [] |
| 230 | +# latex_appendices = [] |
229 | 231 |
|
230 | 232 | # If false, no module index is generated. |
231 | | -#latex_use_modindex = True |
| 233 | +# latex_use_modindex = True |
0 commit comments