Permalink
Browse files

Remove trailing whitespace from lines.

  • Loading branch information...
1 parent 6189a69 commit a8ac916781efdb694fc2e739743460203794a1e6 @josephw josephw committed Sep 14, 2012
Showing with 252 additions and 252 deletions.
  1. +1 −1 docs-xml/build-docs-index.py
  2. +1 −1 docs-xml/build-html-docs.py
  3. +3 −3 docs-xml/mkmsgs.py
  4. +13 −13 fcgi.py
  5. +17 −17 feedfinder.py
  6. +20 −20 src/feedvalidator/__init__.py
  7. +3 −3 src/feedvalidator/author.py
  8. +10 −10 src/feedvalidator/base.py
  9. +12 −12 src/feedvalidator/channel.py
  10. +1 −1 src/feedvalidator/content.py
  11. +2 −2 src/feedvalidator/entry.py
  12. +13 −13 src/feedvalidator/extension.py
  13. +5 −5 src/feedvalidator/feed.py
  14. +1 −1 src/feedvalidator/formatter/application_test.py
  15. +4 −4 src/feedvalidator/formatter/base.py
  16. +4 −4 src/feedvalidator/formatter/text_html.py
  17. +1 −1 src/feedvalidator/formatter/text_xml.py
  18. +3 −3 src/feedvalidator/image.py
  19. +1 −1 src/feedvalidator/iso639codes.py
  20. +5 −5 src/feedvalidator/item.py
  21. +11 −11 src/feedvalidator/itunes.py
  22. +3 −3 src/feedvalidator/link.py
  23. +9 −9 src/feedvalidator/logging.py
  24. +2 −2 src/feedvalidator/mediaTypes.py
  25. +5 −5 src/feedvalidator/opml.py
  26. +3 −3 src/feedvalidator/rdf.py
  27. +2 −2 src/feedvalidator/root.py
  28. +2 −2 src/feedvalidator/rss.py
  29. +1 −1 src/feedvalidator/skipDays.py
  30. +1 −1 src/feedvalidator/skipHours.py
  31. +3 −3 src/feedvalidator/sse.py
  32. +16 −16 src/feedvalidator/timeoutsocket.py
  33. +3 −3 src/feedvalidator/uri.py
  34. +14 −14 src/feedvalidator/validators.py
  35. +1 −1 src/feedvalidator/xmlEncoding.py
  36. +3 −3 src/index.py
  37. +1 −1 src/rdflib/BNode.py
  38. +6 −6 src/rdflib/Literal.py
  39. +1 −1 src/rdflib/URIRef.py
  40. +1 −1 src/rdflib/constants.py
  41. +2 −2 src/rdflib/exceptions.py
  42. +33 −33 src/rdflib/syntax/parsers/RDFXMLHandler.py
  43. +2 −2 src/rdflib/syntax/xml_names.py
  44. +1 −1 src/tests/testMediaTypes.py
  45. +2 −2 src/tests/testUri.py
  46. +2 −2 src/validtest.py
  47. +2 −2 src/ws-demo.py
@@ -58,7 +58,7 @@ def printLine(hr, msg):
for (f, msg) in allMsgs:
printLine(type + '/' + f + '.html', msg)
of.write("</ul>\n")
-
+
f = open('docs-index-footer.html')
of.write(f.read())
f.close()
@@ -64,7 +64,7 @@ def writeDoc(x, h):
title = trimWS(title)
doc = doc.replace('<title></title>', '<title>' + title + '</title>')
-
+
for (sec, txt) in secRe.findall(t):
r = re.compile('<h2>' + sec + '</h2>\s*<div class="docbody">\s*()</div>', re.IGNORECASE)
idx = r.search(doc).start(1)
View
@@ -32,9 +32,9 @@ def missing():
dir = 'warning'
else:
continue
-
+
xml = path.join(basename, 'docs-xml', dir, key.__name__+'.xml')
-
+
if not path.exists(xml):
result.append((dir, key.__name__, value, xml))
@@ -55,7 +55,7 @@ def buildTestSuite():
if __name__ == '__main__':
import re
for dir, id, msg, xml in missing():
- msg = re.sub("%\(\w+\)\w?", "<code>foo</code>", msg)
+ msg = re.sub("%\(\w+\)\w?", "<code>foo</code>", msg)
if not path.exists(xml):
open(xml,'w').write(template.lstrip() % msg)
print xml
View
26 fcgi.py
@@ -445,7 +445,7 @@ def encode_pair(name, value):
s += struct.pack('!L', valueLength | 0x80000000L)
return s + name + value
-
+
class Record(object):
"""
A FastCGI Record.
@@ -494,15 +494,15 @@ def read(self, sock):
if length < FCGI_HEADER_LEN:
raise EOFError
-
+
self.version, self.type, self.requestId, self.contentLength, \
self.paddingLength = struct.unpack(FCGI_Header, header)
if __debug__: _debug(9, 'read: fd = %d, type = %d, requestId = %d, '
'contentLength = %d' %
(sock.fileno(), self.type, self.requestId,
self.contentLength))
-
+
if self.contentLength:
try:
self.contentData, length = self._recvall(sock,
@@ -556,7 +556,7 @@ def write(self, sock):
self._sendall(sock, self.contentData)
if self.paddingLength:
self._sendall(sock, '\x00'*self.paddingLength)
-
+
class Request(object):
"""
Represents a single FastCGI request.
@@ -596,7 +596,7 @@ def run(self):
def _end(self, appStatus=0L, protocolStatus=FCGI_REQUEST_COMPLETE):
self._conn.end_request(self, appStatus, protocolStatus)
-
+
def _flush(self):
self.stdout.close()
self.stderr.close()
@@ -609,14 +609,14 @@ def __init__(self, server):
self.role = FCGI_RESPONDER
self.flags = 0
self.aborted = False
-
+
self.server = server
self.params = dict(os.environ)
self.stdin = sys.stdin
self.stdout = StdoutWrapper(sys.stdout) # Oh, the humanity!
self.stderr = sys.stderr
self.data = StringIO.StringIO()
-
+
def _end(self, appStatus=0L, protocolStatus=FCGI_REQUEST_COMPLETE):
sys.exit(appStatus)
@@ -657,7 +657,7 @@ def _cleanupSocket(self):
except:
pass
self._sock.close()
-
+
def run(self):
"""Begin processing data from the socket."""
self._keepGoing = True
@@ -818,7 +818,7 @@ def _do_unknown_type(self, inrec):
outrec.contentData = struct.pack(FCGI_UnknownTypeBody, inrec.type)
outrec.contentLength = FCGI_UnknownTypeBody_LEN
self.writeRecord(rec)
-
+
class MultiplexedConnection(Connection):
"""
A version of Connection capable of handling multiple requests
@@ -845,7 +845,7 @@ def _cleanupSocket(self):
self._lock.release()
super(MultiplexedConnection, self)._cleanupSocket()
-
+
def writeRecord(self, rec):
# Must use locking to prevent intermingling of Records from different
# threads.
@@ -904,7 +904,7 @@ def _do_data(self, inrec):
super(MultiplexedConnection, self)._do_data(inrec)
finally:
self._lock.release()
-
+
class Server(object):
"""
The FastCGI server.
@@ -1043,7 +1043,7 @@ def _installSignalHandlers(self):
def _restoreSignalHandlers(self):
for signum,handler in self._oldSIGs:
signal.signal(signum, handler)
-
+
def _hupHandler(self, signum, frame):
self._hupReceived = True
self._keepGoing = False
@@ -1290,7 +1290,7 @@ def _sanitizeEnv(self, environ):
'required by WSGI!\n' %
(self.__class__.__name__, name))
environ[name] = default
-
+
if __name__ == '__main__':
def test_app(environ, start_response):
"""Probably not the most efficient example."""
View
@@ -10,8 +10,8 @@
'http://scripting.com/rss.xml'
>>>
>>> feedfinder.feeds('scripting.com')
- ['http://delong.typepad.com/sdj/atom.xml',
- 'http://delong.typepad.com/sdj/index.rdf',
+ ['http://delong.typepad.com/sdj/atom.xml',
+ 'http://delong.typepad.com/sdj/index.rdf',
'http://delong.typepad.com/sdj/rss.xml']
>>>
@@ -25,10 +25,10 @@
1. If the URI points to a feed, it is simply returned; otherwise
the page is downloaded and the real fun begins.
2. Feeds pointed to by LINK tags in the header of the page (autodiscovery)
- 3. <A> links to feeds on the same server ending in ".rss", ".rdf", ".xml", or
+ 3. <A> links to feeds on the same server ending in ".rss", ".rdf", ".xml", or
".atom"
4. <A> links to feeds on the same server containing "rss", "rdf", "xml", or "atom"
- 5. <A> links to feeds on external servers ending in ".rss", ".rdf", ".xml", or
+ 5. <A> links to feeds on external servers ending in ".rss", ".rdf", ".xml", or
".atom"
6. <A> links to feeds on external servers containing "rss", "rdf", "xml", or "atom"
7. Try some guesses about common places for feeds (index.xml, atom.xml, etc.).
@@ -62,13 +62,13 @@ def __init__(self):
threading.Thread.__init__(self)
self.result = None
self.error = None
-
+
def run(self):
try:
self.result = function(*args, **kw)
except:
self.error = sys.exc_info()
-
+
c = Calculator()
c.setDaemon(True) # don't hold up exiting
c.start()
@@ -80,7 +80,7 @@ def run(self):
return c.result
return internal2
return internal
-
+
# XML-RPC support allows feedfinder to query Syndic8 for possible matches.
# Python 2.3 now comes with this module by default, otherwise you can download it
try:
@@ -94,10 +94,10 @@ def dict(aList):
for k, v in aList:
rc[k] = v
return rc
-
+
def _debuglog(message):
if _debug: print message
-
+
class URLGatekeeper:
"""a class to track robots.txt rules across multiple servers"""
def __init__(self):
@@ -108,7 +108,7 @@ def __init__(self):
self.urlopener.addheaders = [('User-agent', self.urlopener.version)]
robotparser.URLopener.version = self.urlopener.version
robotparser.URLopener.addheaders = self.urlopener.addheaders
-
+
def _getrp(self, url):
protocol, domain = urlparse.urlparse(url)[:2]
if self.rpcache.has_key(domain):
@@ -123,7 +123,7 @@ def _getrp(self, url):
pass
self.rpcache[domain] = rp
return rp
-
+
def can_fetch(self, url):
rp = self._getrp(url)
allow = rp.can_fetch(self.urlopener.version, url)
@@ -145,7 +145,7 @@ def __init__(self, baseuri):
sgmllib.SGMLParser.__init__(self)
self.links = []
self.baseuri = baseuri
-
+
def normalize_attrs(self, attrs):
def cleanattr(v):
v = sgmllib.charref.sub(lambda m: unichr(int(m.groups()[0])), v)
@@ -155,14 +155,14 @@ def cleanattr(v):
attrs = [(k.lower(), cleanattr(v)) for k, v in attrs]
attrs = [(k, k in ('rel','type') and v.lower() or v) for k, v in attrs]
return attrs
-
+
def do_base(self, attrs):
attrsD = dict(self.normalize_attrs(attrs))
if not attrsD.has_key('href'): return
self.baseuri = attrsD['href']
-
+
def error(self, *a, **kw): pass # we're not picky
-
+
class LinkParser(BaseParser):
FEED_TYPES = ('application/rss+xml',
'text/xml',
@@ -247,7 +247,7 @@ def getFeedsFromSyndic8(uri):
except:
pass
return feeds
-
+
def feeds(uri, all=False, querySyndic8=False):
fulluri = makeFullURI(uri)
try:
@@ -346,7 +346,7 @@ def test():
uri = urlparse.urljoin(uri, data.split('<link rel="next" href="').pop().split('"')[0])
print
print count, 'tests executed,', len(failed), 'failed'
-
+
if __name__ == '__main__':
args = sys.argv[1:]
if args and args[0] == '--debug':
Oops, something went wrong.

0 comments on commit a8ac916

Please sign in to comment.