Running lucasdemarchi/codespell to fix typos in code

This commit is contained in:
Capi Etheriel 2014-03-06 12:41:38 -03:00
parent 20a8237910
commit 4de45c942e
8 changed files with 18 additions and 18 deletions

View File

@ -57,12 +57,12 @@ class ReturnsContract(Contract):
self.max_bound = float('inf')
def post_process(self, output):
occurences = 0
occurrences = 0
for x in output:
if isinstance(x, self.obj_type):
occurences += 1
occurrences += 1
assertion = (self.min_bound <= occurences <= self.max_bound)
assertion = (self.min_bound <= occurrences <= self.max_bound)
if not assertion:
if self.min_bound == self.max_bound:
@ -71,7 +71,7 @@ class ReturnsContract(Contract):
expected = '%s..%s' % (self.min_bound, self.max_bound)
raise ContractFail("Returned %s %s, expected %s" % \
(occurences, self.obj_name, expected))
(occurrences, self.obj_name, expected))
class ScrapesContract(Contract):

View File

@ -45,7 +45,7 @@ class BaseSgmlLinkExtractor(FixedSGMLParser):
def _process_links(self, links):
""" Normalize and filter extracted links
The subclass should override it if neccessary
The subclass should override it if necessary
"""
links = unique_list(links, key=lambda link: link.url) if self.unique else links
return links

View File

@ -21,7 +21,7 @@ class MemoryUsage(object):
if not crawler.settings.getbool('MEMUSAGE_ENABLED'):
raise NotConfigured
try:
# stdlib's resource module is only availabe on unix platforms.
# stdlib's resource module is only available on unix platforms.
self.resource = import_module('resource')
except ImportError:
raise NotConfigured

View File

@ -121,7 +121,7 @@ class Scraper(object):
return dfd
def _scrape2(self, request_result, request, spider):
"""Handle the diferent cases of request's result been a Response or a
"""Handle the different cases of request's result been a Response or a
Failure"""
if not isinstance(request_result, Failure):
return self.spidermw.scrape_response(self.call_spider, \

View File

@ -1,6 +1,6 @@
"""
This module implements a class which returns the appropiate Response class
based on different criterias.
This module implements a class which returns the appropriate Response class
based on different criteria.
"""
@ -38,7 +38,7 @@ class ResponseTypes(object):
self.classes[mimetype] = load_object(cls)
def from_mimetype(self, mimetype):
"""Return the most appropiate Response class for the given mimetype"""
"""Return the most appropriate Response class for the given mimetype"""
if mimetype is None:
return Response
elif mimetype in self.classes:
@ -48,7 +48,7 @@ class ResponseTypes(object):
return self.classes.get(basetype, Response)
def from_content_type(self, content_type, content_encoding=None):
"""Return the most appropiate Response class from an HTTP Content-Type
"""Return the most appropriate Response class from an HTTP Content-Type
header """
if content_encoding:
return Response
@ -64,7 +64,7 @@ class ResponseTypes(object):
return Response
def from_headers(self, headers):
"""Return the most appropiate Response class by looking at the HTTP
"""Return the most appropriate Response class by looking at the HTTP
headers"""
cls = Response
if 'Content-Type' in headers:
@ -75,7 +75,7 @@ class ResponseTypes(object):
return cls
def from_filename(self, filename):
"""Return the most appropiate Response class from a file name"""
"""Return the most appropriate Response class from a file name"""
mimetype, encoding = self.mimetypes.guess_type(filename)
if mimetype and not encoding:
return self.from_mimetype(mimetype)
@ -83,7 +83,7 @@ class ResponseTypes(object):
return Response
def from_body(self, body):
"""Try to guess the appropiate response based on the body content.
"""Try to guess the appropriate response based on the body content.
This method is a bit magic and could be improved in the future, but
it's not meant to be used except for special cases where response types
cannot be guess using more straightforward methods."""
@ -98,7 +98,7 @@ class ResponseTypes(object):
return self.from_mimetype('text')
def from_args(self, headers=None, url=None, filename=None, body=None):
"""Guess the most appropiate Response class based on the given arguments"""
"""Guess the most appropriate Response class based on the given arguments"""
cls = Response
if headers is not None:
cls = self.from_headers(headers)

View File

@ -27,7 +27,7 @@ def function(receiver):
# an instance-method...
return receiver, receiver.im_func.func_code, 1
elif not hasattr(receiver, 'func_code'):
raise ValueError('unknown reciever type %s %s'%(receiver, type(receiver)))
raise ValueError('unknown receiver type %s %s'%(receiver, type(receiver)))
return receiver, receiver.func_code, 0

View File

@ -581,7 +581,7 @@ class Request:
# In the future, having the protocol version be a parameter to this
# method would probably be good. It would be nice if this method
# weren't limited to issueing HTTP/1.1 requests.
# weren't limited to issuing HTTP/1.1 requests.
requestLines = []
requestLines.append(
'%s %s HTTP/1.1\r\n' % (self.method, self.uri))

View File

@ -849,7 +849,7 @@ class IReactorMulticast(Interface):
UDP socket methods that support multicast.
IMPORTANT: This is an experimental new interface. It may change
without backwards compatability. Suggestions are welcome.
without backwards compatibility. Suggestions are welcome.
"""
def listenMulticast(port, protocol, interface='', maxPacketSize=8192,