|
15 | 15 | import os |
16 | 16 | import sys |
17 | 17 |
|
18 | | -from nine import versions |
19 | | - |
20 | 18 | # If extensions (or modules to document with autodoc) are in another directory, |
21 | 19 | # add these directories to sys.path here. If the directory is relative to the |
22 | 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
23 | 21 | # sys.path.insert(0, os.path.abspath('.')) |
24 | | -sys.path.insert(0, os.path.abspath(os.path.join('..', 'src'))) |
25 | | -sys.path.insert(0, os.path.abspath(os.path.join('..', 'examples'))) |
26 | | -sys.path.insert(0, os.path.abspath(os.path.join('..', 'examples', 'simple'))) |
| 22 | +sys.path.insert(0, os.path.abspath(os.path.join("..", "src"))) |
| 23 | +sys.path.insert(0, os.path.abspath(os.path.join("..", "examples"))) |
| 24 | +sys.path.insert(0, os.path.abspath(os.path.join("..", "examples", "simple"))) |
27 | 25 | try: |
28 | 26 | import rest_framework_tricks |
29 | 27 | from simple import settings as example_settings |
| 28 | + |
30 | 29 | version = rest_framework_tricks.__version__ |
31 | 30 | project = rest_framework_tricks.__title__ |
32 | 31 | copyright = rest_framework_tricks.__copyright__ |
33 | 32 | except Exception as e: |
34 | | - version = '0.1' |
35 | | - project = u'django-rest-framework-tricks' |
36 | | - copyright = u'2017, Artur Barseghyan <artur.barseghyan@gmail.com>' |
| 33 | + version = "0.1" |
| 34 | + project = u"django-rest-framework-tricks" |
| 35 | + copyright = u"2017, Artur Barseghyan <artur.barseghyan@gmail.com>" |
37 | 36 |
|
38 | 37 | # -- Django configuration ----------------------------------------------------- |
39 | 38 | import django |
|
43 | 42 | INSTALLED_APPS = list(example_settings.INSTALLED_APPS) |
44 | 43 |
|
45 | 44 | configure_kwargs = { |
46 | | - 'DATABASES': example_settings.DATABASES, |
47 | | - 'INSTALLED_APPS': INSTALLED_APPS, |
48 | | - 'MEDIA_ROOT': example_settings.MEDIA_ROOT, |
49 | | - 'MEDIA_URL': example_settings.MEDIA_URL, |
50 | | - 'MIDDLEWARE_CLASSES': example_settings.MIDDLEWARE_CLASSES, |
51 | | - 'ROOT_URLCONF': example_settings.ROOT_URLCONF, |
52 | | - 'SECRET_KEY': example_settings.SECRET_KEY, |
53 | | - 'SITE_ID': example_settings.SITE_ID, |
54 | | - 'STATICFILES_DIRS': example_settings.STATICFILES_DIRS, |
55 | | - 'STATICFILES_FINDERS': example_settings.STATICFILES_FINDERS, |
56 | | - 'STATIC_URL': example_settings.STATIC_URL, |
57 | | - 'STATIC_ROOT': example_settings.STATIC_ROOT, |
| 45 | + "DATABASES": example_settings.DATABASES, |
| 46 | + "INSTALLED_APPS": INSTALLED_APPS, |
| 47 | + "MEDIA_ROOT": example_settings.MEDIA_ROOT, |
| 48 | + "MEDIA_URL": example_settings.MEDIA_URL, |
| 49 | + "MIDDLEWARE_CLASSES": example_settings.MIDDLEWARE_CLASSES, |
| 50 | + "ROOT_URLCONF": example_settings.ROOT_URLCONF, |
| 51 | + "SECRET_KEY": example_settings.SECRET_KEY, |
| 52 | + "SITE_ID": example_settings.SITE_ID, |
| 53 | + "STATICFILES_DIRS": example_settings.STATICFILES_DIRS, |
| 54 | + "STATICFILES_FINDERS": example_settings.STATICFILES_FINDERS, |
| 55 | + "STATIC_URL": example_settings.STATIC_URL, |
| 56 | + "STATIC_ROOT": example_settings.STATIC_ROOT, |
58 | 57 | } |
59 | 58 |
|
60 | | - if versions.DJANGO_GTE_1_8: |
61 | | - configure_kwargs.update({'TEMPLATES':example_settings.TEMPLATES}) |
62 | | - else: |
63 | | - configure_kwargs.update({ |
64 | | - 'TEMPLATE_CONTEXT_PROCESSORS': |
65 | | - example_settings.TEMPLATE_CONTEXT_PROCESSORS, |
66 | | - 'TEMPLATE_DIRS': example_settings.TEMPLATE_DIRS, |
67 | | - 'TEMPLATE_LOADERS': example_settings.TEMPLATE_LOADERS, |
68 | | - }) |
69 | | - |
| 59 | + configure_kwargs.update({"TEMPLATES": example_settings.TEMPLATES}) |
70 | 60 |
|
71 | 61 | settings.configure(**configure_kwargs) |
72 | 62 |
|
|
79 | 69 |
|
80 | 70 | # Add any Sphinx extension module names here, as strings. They can be |
81 | 71 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
82 | | -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] |
| 72 | +extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"] |
83 | 73 |
|
84 | 74 | # Add any paths that contain templates here, relative to this directory. |
85 | | -templates_path = ['_templates'] |
| 75 | +templates_path = ["_templates"] |
86 | 76 |
|
87 | 77 | # The suffix of source filenames. |
88 | | -source_suffix = '.rst' |
| 78 | +source_suffix = ".rst" |
89 | 79 |
|
90 | 80 | # The encoding of source files. |
91 | 81 | # source_encoding = 'utf-8-sig' |
92 | 82 |
|
93 | 83 | # The master toctree document. |
94 | | -master_doc = 'index' |
| 84 | +master_doc = "index" |
95 | 85 |
|
96 | 86 | # General information about the project. |
97 | 87 | # project = u'django-rest-framework-tricks' |
|
119 | 109 |
|
120 | 110 | # List of patterns, relative to source directory, that match files and |
121 | 111 | # directories to ignore when looking for source files. |
122 | | -exclude_patterns = ['_build'] |
| 112 | +exclude_patterns = ["_build"] |
123 | 113 |
|
124 | 114 | # The reST default role (used for this markup: `text`) to use for all |
125 | 115 | # documents. |
|
137 | 127 | # show_authors = False |
138 | 128 |
|
139 | 129 | # The name of the Pygments (syntax highlighting) style to use. |
140 | | -pygments_style = 'sphinx' |
| 130 | +pygments_style = "sphinx" |
141 | 131 |
|
142 | 132 | # A list of ignored prefixes for module index sorting. |
143 | 133 | # modindex_common_prefix = [] |
|
147 | 137 |
|
148 | 138 | # The theme to use for HTML and HTML Help pages. See the documentation for |
149 | 139 | # a list of builtin themes. |
150 | | -html_theme = 'default' |
| 140 | +html_theme = "default" |
151 | 141 |
|
152 | 142 | # Theme options are theme-specific and customize the look and feel of a theme |
153 | 143 | # further. For a list of options available for each theme, see the |
|
176 | 166 | # Add any paths that contain custom static files (such as style sheets) here, |
177 | 167 | # relative to this directory. They are copied after the builtin static files, |
178 | 168 | # so a file named "default.css" will overwrite the builtin "default.css". |
179 | | -html_static_path = ['_static'] |
| 169 | +html_static_path = ["_static"] |
180 | 170 |
|
181 | 171 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
182 | 172 | # using the given strftime format. |
|
220 | 210 | # html_file_suffix = None |
221 | 211 |
|
222 | 212 | # Output file base name for HTML help builder. |
223 | | -htmlhelp_basename = 'django-rest-framework-tricksdoc' |
| 213 | +htmlhelp_basename = "django-rest-framework-tricksdoc" |
224 | 214 |
|
225 | 215 |
|
226 | 216 | # -- Options for LaTeX output ------------------------------------------------- |
227 | 217 |
|
228 | 218 | latex_elements = { |
229 | | -# The paper size ('letterpaper' or 'a4paper'). |
230 | | -# 'papersize': 'letterpaper', |
231 | | - |
232 | | -# The font size ('10pt', '11pt' or '12pt'). |
233 | | -# 'pointsize': '10pt', |
234 | | - |
235 | | -# Additional stuff for the LaTeX preamble. |
236 | | -# 'preamble': '', |
| 219 | + # The paper size ('letterpaper' or 'a4paper'). |
| 220 | + # 'papersize': 'letterpaper', |
| 221 | + # The font size ('10pt', '11pt' or '12pt'). |
| 222 | + # 'pointsize': '10pt', |
| 223 | + # Additional stuff for the LaTeX preamble. |
| 224 | + # 'preamble': '', |
237 | 225 | } |
238 | 226 |
|
239 | 227 | # Grouping the document tree into LaTeX files. List of tuples |
240 | 228 | # (source start file, target name, title, author, documentclass |
241 | 229 | # [howto/manual]). |
242 | 230 | latex_documents = [ |
243 | | - ('index', |
244 | | - 'django-rest-framework-tricks.tex', |
245 | | - u'django-rest-framework-tricks Documentation', |
246 | | - u'Artur Barseghyan \\textless{}artur.barseghyan@gmail.com\\textgreater{}', |
247 | | - 'manual'), |
| 231 | + ( |
| 232 | + "index", |
| 233 | + "django-rest-framework-tricks.tex", |
| 234 | + u"django-rest-framework-tricks Documentation", |
| 235 | + u"Artur Barseghyan \\textless{}artur.barseghyan@gmail.com\\textgreater{}", |
| 236 | + "manual", |
| 237 | + ), |
248 | 238 | ] |
249 | 239 |
|
250 | 240 | # The name of an image file (relative to this directory) to place at the top |
|
273 | 263 | # One entry per manual page. List of tuples |
274 | 264 | # (source start file, name, description, authors, manual section). |
275 | 265 | man_pages = [ |
276 | | - ('index', |
277 | | - 'django-rest-framework-tricks', |
278 | | - u'django-rest-framework-tricks Documentation', |
279 | | - [u'Artur Barseghyan <artur.barseghyan@gmail.com>'], |
280 | | - 1) |
| 266 | + ( |
| 267 | + "index", |
| 268 | + "django-rest-framework-tricks", |
| 269 | + u"django-rest-framework-tricks Documentation", |
| 270 | + [u"Artur Barseghyan <artur.barseghyan@gmail.com>"], |
| 271 | + 1, |
| 272 | + ) |
281 | 273 | ] |
282 | 274 |
|
283 | 275 | # If true, show URL addresses after external links. |
|
290 | 282 | # (source start file, target name, title, author, |
291 | 283 | # dir menu entry, description, category) |
292 | 284 | texinfo_documents = [ |
293 | | - ('index', 'django-rest-framework-tricks', |
294 | | - u'django-rest-framework-tricks Documentation', |
295 | | - u'Artur Barseghyan <artur.barseghyan@gmail.com>', |
296 | | - 'django-rest-framework-tricks', |
297 | | - "Integrate Elasticsearch DSL with Django REST framework.", |
298 | | - 'Miscellaneous'), |
| 285 | + ( |
| 286 | + "index", |
| 287 | + "django-rest-framework-tricks", |
| 288 | + u"django-rest-framework-tricks Documentation", |
| 289 | + u"Artur Barseghyan <artur.barseghyan@gmail.com>", |
| 290 | + "django-rest-framework-tricks", |
| 291 | + "Integrate Elasticsearch DSL with Django REST framework.", |
| 292 | + "Miscellaneous", |
| 293 | + ), |
299 | 294 | ] |
300 | 295 |
|
301 | 296 | # Documents to append as an appendix to all manuals. |
|
311 | 306 | # -- Options for Epub output -------------------------------------------------- |
312 | 307 |
|
313 | 308 | # Bibliographic Dublin Core info. |
314 | | -epub_title = u'django-rest-framework-tricks' |
315 | | -epub_author = u'Artur Barseghyan <artur.barseghyan@gmail.com>' |
316 | | -epub_publisher = u'Artur Barseghyan <artur.barseghyan@gmail.com>' |
317 | | -epub_copyright = u'2017, Artur Barseghyan <artur.barseghyan@gmail.com>' |
| 309 | +epub_title = u"django-rest-framework-tricks" |
| 310 | +epub_author = u"Artur Barseghyan <artur.barseghyan@gmail.com>" |
| 311 | +epub_publisher = u"Artur Barseghyan <artur.barseghyan@gmail.com>" |
| 312 | +epub_copyright = u"2017, Artur Barseghyan <artur.barseghyan@gmail.com>" |
318 | 313 |
|
319 | 314 | # The language of the text. It defaults to the language option |
320 | 315 | # or en if the language is not set. |
|
0 commit comments