Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

PEP8 issues fixed

Fix some PEP8 issues in file doc/source/conf.py to make the code more
pretty.

Change-Id: I2efdb39c8991bf0cae180f7c4ffd459f6b418fc5
  • Loading branch information...
commit b1772999533d16853d3001ed75898253e9964adc 1 parent be20419
Ray Chen authored August 23, 2012

Showing 1 changed file with 31 additions and 21 deletions. Show diff stats Hide diff stats

  1. 52  doc/source/conf.py
52  doc/source/conf.py
@@ -3,7 +3,8 @@
3 3
 # Horizon documentation build configuration file, created by
4 4
 # sphinx-quickstart on Thu Oct 27 11:38:59 2011.
5 5
 #
6  
-# This file is execfile()d with the current directory set to its containing dir.
  6
+# This file is execfile()d with the current directory set to its
  7
+# containing dir.
7 8
 #
8 9
 # Note that not all possible configuration values are present in this
9 10
 # autogenerated file.
@@ -65,7 +66,8 @@ def find_autodoc_modules(module_name, sourcedir):
65 66
     INDEXOUT.write("=================\n")
66 67
 
67 68
     for modulename, path in SRCS.items():
68  
-        sys.stdout.write("Generating source documentation for %s\n" % modulename)
  69
+        sys.stdout.write("Generating source documentation for %s\n" %
  70
+                         modulename)
69 71
         INDEXOUT.write("\n%s\n" % modulename.capitalize())
70 72
         INDEXOUT.write("%s\n" % ("=" * len(modulename),))
71 73
         INDEXOUT.write(".. toctree::\n")
@@ -77,7 +79,8 @@ def find_autodoc_modules(module_name, sourcedir):
77 79
         if not(os.path.exists(MOD_DIR)):
78 80
             os.mkdir(MOD_DIR)
79 81
         for module in find_autodoc_modules(modulename, path):
80  
-            if any([module.startswith(exclude) for exclude in EXCLUDED_MODULES]):
  82
+            if any([module.startswith(exclude) for exclude \
  83
+                                                in EXCLUDED_MODULES]):
81 84
                 print "Excluded module %s." % module
82 85
                 continue
83 86
             mod_path = os.path.join(path, *module.split("."))
@@ -87,7 +90,8 @@ def find_autodoc_modules(module_name, sourcedir):
87 90
 
88 91
             # Find the __init__.py module if this is a directory
89 92
             if os.path.isdir(mod_path):
90  
-                source_file = ".".join((os.path.join(mod_path, "__init__"), "py",))
  93
+                source_file = ".".join((os.path.join(mod_path, "__init__"),
  94
+                                        "py",))
91 95
             else:
92 96
                 source_file = ".".join((os.path.join(mod_path), "py"))
93 97
 
@@ -95,8 +99,10 @@ def find_autodoc_modules(module_name, sourcedir):
95 99
             # Only generate a new file if the source has changed or we don't
96 100
             # have a doc file to begin with.
97 101
             if not os.access(generated_file, os.F_OK) or \
98  
-                    os.stat(generated_file).st_mtime < os.stat(source_file).st_mtime:
99  
-                print "Module %s updated, generating new documentation." % module
  102
+                    os.stat(generated_file).st_mtime < \
  103
+                    os.stat(source_file).st_mtime:
  104
+                print "Module %s updated, generating new documentation." \
  105
+                      % module
100 106
                 FILEOUT = open(generated_file, "w")
101 107
                 header = "The :mod:`%s` Module" % module
102 108
                 FILEOUT.write("%s\n" % ("=" * len(header),))
@@ -126,13 +132,14 @@ def find_autodoc_modules(module_name, sourcedir):
126 132
 # documentation root, use os.path.abspath to make it absolute, like shown here.
127 133
 #sys.path.insert(0, os.path.abspath('.'))
128 134
 
129  
-# -- General configuration -----------------------------------------------------
  135
+# -- General configuration ----------------------------------------------------
130 136
 
131 137
 # If your documentation needs a minimal Sphinx version, state it here.
132 138
 #needs_sphinx = '1.0'
133 139
 
134  
-# Add any Sphinx extension module names here, as strings. They can be extensions
135  
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  140
+# Add any Sphinx extension module names here, as strings.
  141
+# They can be extensions coming with Sphinx (named 'sphinx.ext.*')
  142
+# or your custom ones.
136 143
 extensions = ['sphinx.ext.autodoc',
137 144
               'sphinx.ext.intersphinx',
138 145
               'sphinx.ext.todo',
@@ -182,7 +189,8 @@ def find_autodoc_modules(module_name, sourcedir):
182 189
 # directories to ignore when looking for source files.
183 190
 exclude_patterns = ['**/#*', '**~', '**/#*#']
184 191
 
185  
-# The reST default role (used for this markup: `text`) to use for all documents.
  192
+# The reST default role (used for this markup: `text`)
  193
+# to use for all documents.
186 194
 #default_role = None
187 195
 
188 196
 # If true, '()' will be appended to :func: etc. cross-reference text.
@@ -206,7 +214,7 @@ def find_autodoc_modules(module_name, sourcedir):
206 214
 nitpicky = False
207 215
 
208 216
 
209  
-# -- Options for HTML output ---------------------------------------------------
  217
+# -- Options for HTML output --------------------------------------------------
210 218
 
211 219
 # The theme to use for HTML and HTML Help pages.  See the documentation for
212 220
 # a list of builtin themes.
@@ -291,7 +299,7 @@ def find_autodoc_modules(module_name, sourcedir):
291 299
 htmlhelp_basename = 'Horizondoc'
292 300
 
293 301
 
294  
-# -- Options for LaTeX output --------------------------------------------------
  302
+# -- Options for LaTeX output -------------------------------------------------
295 303
 
296 304
 latex_elements = {
297 305
 # The paper size ('letterpaper' or 'a4paper').
@@ -305,10 +313,11 @@ def find_autodoc_modules(module_name, sourcedir):
305 313
 }
306 314
 
307 315
 # Grouping the document tree into LaTeX files. List of tuples
308  
-# (source start file, target name, title, author, documentclass [howto/manual]).
  316
+# (source start file, target name, title, author, documentclass
  317
+# [howto/manual]).
309 318
 latex_documents = [
310  
-  ('index', 'Horizon.tex', u'Horizon Documentation',
311  
-   u'OpenStack, LLC', 'manual'),
  319
+    ('index', 'Horizon.tex', u'Horizon Documentation',
  320
+     u'OpenStack, LLC', 'manual'),
312 321
 ]
313 322
 
314 323
 # The name of an image file (relative to this directory) to place at the top of
@@ -332,7 +341,7 @@ def find_autodoc_modules(module_name, sourcedir):
332 341
 #latex_domain_indices = True
333 342
 
334 343
 
335  
-# -- Options for manual page output --------------------------------------------
  344
+# -- Options for manual page output -------------------------------------------
336 345
 
337 346
 # One entry per manual page. List of tuples
338 347
 # (source start file, name, description, authors, manual section).
@@ -345,14 +354,14 @@ def find_autodoc_modules(module_name, sourcedir):
345 354
 #man_show_urls = False
346 355
 
347 356
 
348  
-# -- Options for Texinfo output ------------------------------------------------
  357
+# -- Options for Texinfo output -----------------------------------------------
349 358
 
350 359
 # Grouping the document tree into Texinfo files. List of tuples
351 360
 # (source start file, target name, title, author,
352 361
 #  dir menu entry, description, category)
353 362
 texinfo_documents = [
354  
-  ('index', 'Horizon', u'Horizon Documentation', u'OpenStack',
355  
-   'Horizon', 'One line description of project.', 'Miscellaneous'),
  363
+    ('index', 'Horizon', u'Horizon Documentation', u'OpenStack',
  364
+     'Horizon', 'One line description of project.', 'Miscellaneous'),
356 365
 ]
357 366
 
358 367
 # Documents to append as an appendix to all manuals.
@@ -365,7 +374,7 @@ def find_autodoc_modules(module_name, sourcedir):
365 374
 #texinfo_show_urls = 'footnote'
366 375
 
367 376
 
368  
-# -- Options for Epub output ---------------------------------------------------
  377
+# -- Options for Epub output --------------------------------------------------
369 378
 
370 379
 # Bibliographic Dublin Core info.
371 380
 epub_title = u'Horizon'
@@ -410,7 +419,8 @@ def find_autodoc_modules(module_name, sourcedir):
410 419
 
411 420
 # Example configuration for intersphinx: refer to the Python standard library.
412 421
 intersphinx_mapping = {'python': ('http://docs.python.org/', None),
413  
-                       'django': ('http://docs.djangoproject.com/en/dev/_objects/'),
  422
+                       'django':
  423
+                           ('http://docs.djangoproject.com/en/dev/_objects/'),
414 424
                        'nova': ('http://nova.openstack.org', None),
415 425
                        'swift': ('http://swift.openstack.org', None),
416 426
                        'keystone': ('http://keystone.openstack.org', None),

Git Notes

review

Verified+2: Jenkins
Approved+1: Tihomir Trifonov <t.trifonov@gmail.com>
Code-Review+2: Tihomir Trifonov <t.trifonov@gmail.com>
Code-Review+2: John Postlethwait <john.postlethwait@nebula.com>
Submitted-by: Jenkins
Submitted-at: Thu, 23 Aug 2012 08:40:52 +0000
Reviewed-on: https://review.openstack.org/11856
Project: openstack/horizon
Branch: refs/heads/master

0 notes on commit b177299

Please sign in to comment.
Something went wrong with that request. Please try again.