More PEP8 compliancy.

This commit is contained in:
Ryan Petrello
2012-03-20 02:07:42 -04:00
parent c338124379
commit 7455b9ff46
9 changed files with 26 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
# Pecan documentation build configuration file, created by # Pecan documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 9 14:41:27 2010. # sphinx-quickstart on Sat Oct 9 14:41:27 2010.
# #
# This file is execfile()d with the current directory set to its containing dir. # This file is execfile()d w/ the current directory set to its containing dir.
# #
# Note that not all possible configuration values are present in this # Note that not all possible configuration values are present in this
# autogenerated file. # autogenerated file.
@@ -11,20 +11,21 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import sys, os import sys
import os
# If extensions (or modules to document with autodoc) are in another directory, # 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 # 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. # documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.')) #sys.path.append(os.path.abspath('.'))
# -- General configuration ----------------------------------------------------- # -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0' #needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc'] extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
@@ -66,7 +67,7 @@ release = '0.1.0'
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
exclude_patterns = [] 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 documents.
#default_role = None #default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.
@@ -87,7 +88,7 @@ pygments_style = 'sphinx'
#modindex_common_prefix = [] #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 # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
@@ -167,7 +168,7 @@ html_static_path = ['static']
htmlhelp_basename = 'Pecandoc' htmlhelp_basename = 'Pecandoc'
# -- Options for LaTeX output -------------------------------------------------- # -- Options for LaTeX output -------------------------------------------------
# The paper size ('letter' or 'a4'). # The paper size ('letter' or 'a4').
#latex_paper_size = 'letter' #latex_paper_size = 'letter'
@@ -176,7 +177,7 @@ htmlhelp_basename = 'Pecandoc'
#latex_font_size = '10pt' #latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples # 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 = [ latex_documents = [
('index', 'Pecan.tex', u'Pecan Documentation', ('index', 'Pecan.tex', u'Pecan Documentation',
u'Jonathan LaCour', 'manual'), u'Jonathan LaCour', 'manual'),
@@ -206,7 +207,7 @@ latex_documents = [
#latex_domain_indices = True #latex_domain_indices = True
# -- Options for manual page output -------------------------------------------- # -- Options for manual page output -------------------------------------------
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).

View File

@@ -98,7 +98,6 @@ class ServeCommand(BaseCommand):
paths.append((os.path.dirname(conf.__file__), False)) paths.append((os.path.dirname(conf.__file__), False))
return paths return paths
def _serve(self, app, conf): def _serve(self, app, conf):
from wsgiref.simple_server import make_server from wsgiref.simple_server import make_server

View File

@@ -24,7 +24,7 @@ if PY3: # pragma: no cover
return s return s
return str(s, encoding, errors) return str(s, encoding, errors)
else: else:
def native_(s, encoding='latin-1', errors='strict'): # noqa def native_(s, encoding='latin-1', errors='strict'): # noqa
""" If ``s`` is an instance of ``text_type``, return """ If ``s`` is an instance of ``text_type``, return
``s.encode(encoding, errors)``, otherwise return ``str(s)``""" ``s.encode(encoding, errors)``, otherwise return ``str(s)``"""
if isinstance(s, text_type): if isinstance(s, text_type):

View File

@@ -33,7 +33,7 @@ class Config(object):
Create a Pecan configuration object from a dictionary or a Create a Pecan configuration object from a dictionary or a
filename. filename.
:param conf_dict: A python dictionary to use for the configuration. :param conf_dict: A python dictionary to use for the configuration.
:param filename: A filename to use for the configuration. :param filename: A filename to use for the configuration.
''' '''

File diff suppressed because one or more lines are too long

View File

@@ -203,7 +203,7 @@ class RequestViewerHook(PecanHook):
:param terminal: Outputs to the chosen stream writer (usually :param terminal: Outputs to the chosen stream writer (usually
the terminal) the terminal)
:param headers: Sets values to the X-HTTP headers :param headers: Sets values to the X-HTTP headers
Returns some information about what is going on in a single request. It Returns some information about what is going on in a single request. It
accepts specific items to report on but uses a default list of items when accepts specific items to report on but uses a default list of items when
none are passed in. Based on the requested ``url``, items can also be none are passed in. Based on the requested ``url``, items can also be
@@ -212,7 +212,7 @@ class RequestViewerHook(PecanHook):
some or all the keys supported. some or all the keys supported.
**items** **items**
This key holds the items that this hook will display. When this key is This key holds the items that this hook will display. When this key is
passed only the items in the list will be used. Valid items are *any* passed only the items in the list will be used. Valid items are *any*
item that the ``request`` object holds, by default it uses the item that the ``request`` object holds, by default it uses the
@@ -229,7 +229,7 @@ class RequestViewerHook(PecanHook):
This key should always use a ``list`` of items to use. This key should always use a ``list`` of items to use.
**blacklist** **blacklist**
This key holds items that will be blacklisted based on ``url``. If This key holds items that will be blacklisted based on ``url``. If
there is a need to ommit urls that start with `/javascript`, then this there is a need to ommit urls that start with `/javascript`, then this
key would look like:: key would look like::

View File

@@ -41,7 +41,7 @@ class TestDebugMiddleware(TestCase):
app = TestApp(MultiProcessApp(DebugMiddleware(conditional_error_app))) app = TestApp(MultiProcessApp(DebugMiddleware(conditional_error_app)))
self.assertRaises( self.assertRaises(
AssertionError, AssertionError,
app.get, app.get,
'/' '/'
) )

View File

@@ -13,7 +13,7 @@ import pecan
if sys.version_info < (2, 7): if sys.version_info < (2, 7):
import unittest2 as unittest import unittest2 as unittest
else: else:
import unittest # noqa import unittest # noqa
def has_internet(): def has_internet():

View File

@@ -8,7 +8,7 @@ version = '0.1.0'
# determine requirements # determine requirements
# #
requirements = [ requirements = [
"WebOb >= 1.2dev", #py3 compat "WebOb >= 1.2dev", # py3 compat
"simplegeneric >= 0.8", # py3 compat "simplegeneric >= 0.8", # py3 compat
"Mako >= 0.4.0", "Mako >= 0.4.0",
"Paste >= 1.7.5.1", "Paste >= 1.7.5.1",