Skip to content

Commit

Permalink
clean whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
collinanderson committed Sep 10, 2014
1 parent 21ed220 commit 03fbe94
Show file tree
Hide file tree
Showing 32 changed files with 118 additions and 137 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test suite on your branch before submitting a pull request.
Make sure you include relevant updates or additions to documentation
when creating or modifying features.

Write clean code.
Write clean code.

Pull requests descriptions should be as clear as possible and include a
reference to all the issues that they address.
Expand Down Expand Up @@ -147,8 +147,8 @@ benoitc.

### How can I become a maintainer?

* Step 1: learn the component inside out
* Step 2: make yourself useful by contributing code, bugfixes, support etc.
* Step 1: learn the component inside out
* Step 2: make yourself useful by contributing code, bugfixes, support etc.
* Step 3: volunteer on the irc channel (#gunicorn@freenode)

Don't forget: being a maintainer is a time investment. Make sure you
Expand All @@ -160,8 +160,8 @@ maintainer to make a difference on the project!
It is every maintainer's responsibility to:

* 1) Expose a clear roadmap for improving their component.
* 2) Deliver prompt feedback and decisions on pull requests.
* 3) Be available to anyone with questions, bug reports, criticism etc. on their component. This includes irc, github requests and the mailing list.
* 2) Deliver prompt feedback and decisions on pull requests.
* 3) Be available to anyone with questions, bug reports, criticism etc. on their component. This includes irc, github requests and the mailing list.
* 4) Make sure their component respects the philosophy, design and roadmap of the project.

### How is this process changed?
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ After installing Gunicorn you will have access to the command line script
Commonly Used Arguments
+++++++++++++++++++++++

* ``-c CONFIG, --config=CONFIG`` - Specify the path to a `config file`_ or
* ``-c CONFIG, --config=CONFIG`` - Specify the path to a `config file`_ or
python module.
* ``-b BIND, --bind=BIND`` - Specify a server socket to bind. Server sockets
can be any of ``$(HOST)``, ``$(HOST):$(PORT)``, or ``unix:$(PATH)``.
Expand Down Expand Up @@ -147,7 +147,7 @@ Instrumentation
---------------

Gunicorn provides an optional instrumentation of the arbiter and
workers using the statsD_ protocol over UDP. Thanks to the
workers using the statsD_ protocol over UDP. Thanks to the
`gunicorn.instrument.statsd` module, Gunicorn becomes a statsD client
The use of UDP cleanly isolates Gunicorn from the receiving end of the statsD
metrics so that instrumentation does not cause Gunicorn to be held up by a slow
Expand Down
2 changes: 1 addition & 1 deletion docs/sitemap_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

<!-- Exclude github CNAME file -->
<filter action="drop" type="wildcard" pattern="*CNAME" />

</site>
54 changes: 27 additions & 27 deletions docs/sitemap_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def NarrowText(self, text, encoding):
# Something is seriously wrong if we get to here
return text.encode(ENC_ASCII, 'ignore')
#end def NarrowText

def MaybeNarrowPath(self, text):
""" Paths may be allowed to stay wide """
if self._widefiles:
Expand Down Expand Up @@ -484,7 +484,7 @@ def Canonicalize(loc):
""" Do encoding and canonicalization on a URL string """
if not loc:
return loc

# Let the encoder try to narrow it
narrow = encoder.NarrowText(loc, None)

Expand Down Expand Up @@ -545,7 +545,7 @@ def Canonicalize(loc):
def Validate(self, base_url, allow_fragment):
""" Verify the data in this URL is well-formed, and override if not. """
assert type(base_url) == types.StringType

# Test (and normalize) the ref
if not self.loc:
output.Warn('Empty URL')
Expand Down Expand Up @@ -611,7 +611,7 @@ def MakeHash(self):
def Log(self, prefix='URL', level=3):
""" Dump the contents, empty or not, to the log. """
out = prefix + ':'

for attribute in self.__slots__:
value = getattr(self, attribute)
if not value:
Expand All @@ -636,7 +636,7 @@ def WriteXML(self, file):
value = str(value)
value = xml.sax.saxutils.escape(value)
out = out + (' <%s>%s</%s>\n' % (attribute, value, attribute))

out = out + SITEURL_XML_SUFFIX
file.write(out)
#end def WriteXML
Expand Down Expand Up @@ -709,7 +709,7 @@ def Apply(self, url):
""" Process the URL, as above. """
if (not url) or (not url.loc):
return None

if self._wildcard:
if fnmatch.fnmatchcase(url.loc, self._wildcard):
return self._pass
Expand Down Expand Up @@ -738,7 +738,7 @@ def __init__(self, attributes):
if not ValidateAttributes('URL', attributes,
('href', 'lastmod', 'changefreq', 'priority')):
return

url = URL()
for attr in attributes.keys():
if attr == 'href':
Expand All @@ -749,7 +749,7 @@ def __init__(self, attributes):
if not url.loc:
output.Error('Url entries must have an href attribute.')
return

self._url = url
output.Log('Input: From URL "%s"' % self._url.loc, 2)
#end def __init__
Expand All @@ -775,7 +775,7 @@ def __init__(self, attributes):

if not ValidateAttributes('URLLIST', attributes, ('path', 'encoding')):
return

self._path = attributes.get('path')
self._encoding = attributes.get('encoding', ENC_UTF8)
if self._path:
Expand Down Expand Up @@ -808,7 +808,7 @@ def ProduceURLs(self, consumer):
line = line.strip()
if (not line) or line[0] == '#':
continue

# Split the line on space
url = URL()
cols = line.split(' ')
Expand Down Expand Up @@ -1156,7 +1156,7 @@ class InputSitemap(xml.sax.handler.ContentHandler):
"""

class _ContextBase(object):

"""Base class for context handlers in our SAX processing. A context
handler is a class that is responsible for understanding one level of
depth in the XML schema. The class knows what sub-tags are allowed,
Expand All @@ -1165,7 +1165,7 @@ class _ContextBase(object):
This base class is the API filled in by specific context handlers,
all defined below.
"""

def __init__(self, subtags):
"""Initialize with a sequence of the sub-tags that would be valid in
this context."""
Expand Down Expand Up @@ -1209,18 +1209,18 @@ def Return(self, result):
#end class _ContextBase

class _ContextUrlSet(_ContextBase):

"""Context handler for the document node in a Sitemap."""

def __init__(self):
InputSitemap._ContextBase.__init__(self, ('url',))
#end def __init__
#end class _ContextUrlSet

class _ContextUrl(_ContextBase):

"""Context handler for a URL node in a Sitemap."""

def __init__(self, consumer):
"""Initialize this context handler with the callable consumer that
wants our URLs."""
Expand All @@ -1241,7 +1241,7 @@ def Close(self):
self._consumer(self._url, False)
self._url = None
#end def Close

def Return(self, result):
"""A value context has closed, absorb the data it gave us."""
assert self._url
Expand All @@ -1251,9 +1251,9 @@ def Return(self, result):
#end class _ContextUrl

class _ContextSitemapIndex(_ContextBase):

"""Context handler for the document node in an index file."""

def __init__(self):
InputSitemap._ContextBase.__init__(self, ('sitemap',))
self._loclist = [] # List of accumulated Sitemap URLs
Expand All @@ -1271,7 +1271,7 @@ def Close(self):
self._loclist = []
return temp
#end def Close

def Return(self, result):
"""Getting a new loc URL, add it to the collection."""
if result:
Expand All @@ -1280,9 +1280,9 @@ def Return(self, result):
#end class _ContextSitemapIndex

class _ContextSitemap(_ContextBase):

"""Context handler for a Sitemap entry in an index file."""

def __init__(self):
InputSitemap._ContextBase.__init__(self, ('loc', 'lastmod'))
self._loc = None # The URL to the Sitemap
Expand Down Expand Up @@ -1310,10 +1310,10 @@ def Return(self, result):
#end class _ContextSitemap

class _ContextValue(_ContextBase):

"""Context handler for a single value. We return just the value. The
higher level context has to remember what tag led into us."""

def __init__(self):
InputSitemap._ContextBase.__init__(self, ())
self._text = None
Expand Down Expand Up @@ -1355,7 +1355,7 @@ def __init__(self, attributes):

if not ValidateAttributes('SITEMAP', attributes, ['path']):
return

# Init the first file path
path = attributes.get('path')
if path:
Expand Down Expand Up @@ -1388,7 +1388,7 @@ def ProduceURLs(self, consumer):
self._contexts_idx = [InputSitemap._ContextSitemapIndex(),
InputSitemap._ContextSitemap(),
InputSitemap._ContextValue()]

self._contexts_stm = [InputSitemap._ContextUrlSet(),
InputSitemap._ContextUrl(consumer),
InputSitemap._ContextValue()]
Expand All @@ -1408,7 +1408,7 @@ def ProduceURLs(self, consumer):
def _ProcessFile(self, path):
"""Do per-file reading/parsing/consuming for the file path passed in."""
assert path

# Open our file
(frame, file) = OpenFileForRead(path, 'SITEMAP')
if not file:
Expand Down
Loading

0 comments on commit 03fbe94

Please sign in to comment.