Fix PEP8 issues.

Fix some pep8 issues in doc/source/conf.py and tests/test_shell.py  make the code looks pretty.

Change-Id: I927f03aff4190f1ac30eb56e7c545de555978c31
This commit is contained in:
lrqrun 2012-08-29 14:17:08 +08:00
parent 8010e773ac
commit 2372142eaa
2 changed files with 32 additions and 21 deletions

View File

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
#
# OpenStack Command Line Client documentation build configuration file, created by
# sphinx-quickstart on Wed May 16 12:05:58 2012.
# OpenStack Command Line Client documentation build configuration file, created
# by sphinx-quickstart on Wed May 16 12:05:58 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
@ -11,21 +12,25 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -66,7 +71,8 @@ release = '0.1'
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
@ -87,7 +93,7 @@ pygments_style = 'sphinx'
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@ -167,7 +173,7 @@ html_static_path = ['_static']
htmlhelp_basename = 'OpenStackCommandLineClientdoc'
# -- Options for LaTeX output --------------------------------------------------
# -- Options for LaTeX output -------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
@ -181,10 +187,12 @@ latex_elements = {
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
# (source start file, target name, title, author, documentclass [howto/manual])
# .
latex_documents = [
('index', 'OpenStackCommandLineClient.tex', u'OpenStack Command Line Client Documentation',
u'OpenStack', 'manual'),
('index', 'OpenStackCommandLineClient.tex',
u'OpenStack Command Line Client Documentation',
u'OpenStack', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -208,12 +216,13 @@ latex_documents = [
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# -- Options for manual page output -------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'openstackcommandlineclient', u'OpenStack Command Line Client Documentation',
('index', 'openstackcommandlineclient',
u'OpenStack Command Line Client Documentation',
[u'OpenStack'], 1)
]
@ -221,15 +230,17 @@ man_pages = [
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# -- Options for Texinfo output -----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'OpenStackCommandLineClient', u'OpenStack Command Line Client Documentation',
u'OpenStack', 'OpenStackCommandLineClient', 'One line description of project.',
'Miscellaneous'),
('index', 'OpenStackCommandLineClient',
u'OpenStack Command Line Client Documentation',
u'OpenStack', 'OpenStackCommandLineClient',
'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.

View File

@ -66,7 +66,7 @@ class ShellTest(utils.TestCase):
# Make a fake shell object, a helping wrapper to call it, and a quick
# way of asserting that certain API calls were made.
global shell, _shell, assert_called, assert_called_anytime
shell = lambda sh,cmd: sh.run(cmd.split())
shell = lambda sh, cmd: sh.run(cmd.split())
# Patch out some common methods
#self.auth_patch = mock.patch(