Commit 05d319c4 authored by Denis Bilenko's avatar Denis Bilenko

kill trailing whitespace

parent 5e86f916
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Chat Demo</title> <title>Chat Demo</title>
<link rel="stylesheet" href="{{ MEDIA_URL }}chat.css" type="text/css"/> <link rel="stylesheet" href="{{ MEDIA_URL }}chat.css" type="text/css"/>
</head> </head>
......
...@@ -7,7 +7,7 @@ urlpatterns = patterns('webchat.chat.views', ...@@ -7,7 +7,7 @@ urlpatterns = patterns('webchat.chat.views',
('^a/message/updates$', 'message_updates')) ('^a/message/updates$', 'message_updates'))
urlpatterns += patterns('django.views.static', urlpatterns += patterns('django.views.static',
(r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'), (r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'),
'serve', { 'serve', {
'document_root': settings.MEDIA_ROOT, 'document_root': settings.MEDIA_ROOT,
'show_indexes': True })) 'show_indexes': True }))
......
...@@ -120,7 +120,7 @@ def backdoor((conn, addr), locals=None): ...@@ -120,7 +120,7 @@ def backdoor((conn, addr), locals=None):
class _fileobject(socket._fileobject): class _fileobject(socket._fileobject):
def write(self, data): def write(self, data):
self._sock.sendall(data) self._sock.sendall(data)
......
...@@ -117,7 +117,7 @@ class AsyncResult(object): ...@@ -117,7 +117,7 @@ class AsyncResult(object):
Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception` method Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception` method
is called. Waiters may receive the passed value or exception by calling :meth:`get` is called. Waiters may receive the passed value or exception by calling :meth:`get`
method instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset. method instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset.
To pass a value call :meth:`set`. Calls to :meth:`get` (those that currently blocking as well as To pass a value call :meth:`set`. Calls to :meth:`get` (those that currently blocking as well as
those made in the future) will return the value: those made in the future) will return the value:
......
...@@ -102,11 +102,10 @@ class HTTPServer(object): ...@@ -102,11 +102,10 @@ class HTTPServer(object):
requests = self._requests.get(request.connection._obj) requests = self._requests.get(request.connection._obj)
if requests is not None: if requests is not None:
requests.remove(request) requests.remove(request)
def _cb_request(self, request): def _cb_request(self, request):
try: try:
spawn = self.spawn spawn = self.spawn
# we're setting the callback here anyway, because
request.connection.set_closecb(self) request.connection.set_closecb(self)
self._requests.setdefault(request.connection._obj, []).append(request) self._requests.setdefault(request.connection._obj, []).append(request)
if spawn is None: if spawn is None:
......
...@@ -188,7 +188,7 @@ class Hub(greenlet): ...@@ -188,7 +188,7 @@ class Hub(greenlet):
class DispatchExit(Exception): class DispatchExit(Exception):
def __init__(self, code): def __init__(self, code):
self.code = code self.code = code
Exception.__init__(self, code) Exception.__init__(self, code)
......
...@@ -10,7 +10,7 @@ __all__ = ['GreenletSet', 'Pool'] ...@@ -10,7 +10,7 @@ __all__ = ['GreenletSet', 'Pool']
class GreenletSet(object): class GreenletSet(object):
"""Maintain a set of greenlets that are still running. """Maintain a set of greenlets that are still running.
Links to each item and removes it upon notification. Links to each item and removes it upon notification.
""" """
greenlet_class = Greenlet greenlet_class = Greenlet
...@@ -164,7 +164,7 @@ class GreenletSet(object): ...@@ -164,7 +164,7 @@ class GreenletSet(object):
g.rawlink(q.put) g.rawlink(q.put)
for _ in xrange(len(greenlets)): for _ in xrange(len(greenlets)):
yield q.get().get() yield q.get().get()
def full(self): def full(self):
return False return False
......
...@@ -131,7 +131,7 @@ class Input(object): ...@@ -131,7 +131,7 @@ class Input(object):
class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler): class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
protocol_version = 'HTTP/1.1' protocol_version = 'HTTP/1.1'
minimum_chunk_size = MINIMUM_CHUNK_SIZE minimum_chunk_size = MINIMUM_CHUNK_SIZE
def handle_one_request(self): def handle_one_request(self):
if self.server.max_http_version: if self.server.max_http_version:
self.protocol_version = self.server.max_http_version self.protocol_version = self.server.max_http_version
...@@ -381,10 +381,10 @@ class Server(BaseHTTPServer.HTTPServer): ...@@ -381,10 +381,10 @@ class Server(BaseHTTPServer.HTTPServer):
self.log.write(message + '\n') self.log.write(message + '\n')
def server(sock, site, log=None, environ=None, max_size=None, max_http_version=DEFAULT_MAX_HTTP_VERSION, def server(sock, site, log=None, environ=None, max_size=None, max_http_version=DEFAULT_MAX_HTTP_VERSION,
protocol=HttpProtocol, minimum_chunk_size=None): protocol=HttpProtocol, minimum_chunk_size=None):
serv = Server(sock, sock.getsockname(), site, log, environ=None, serv = Server(sock, sock.getsockname(), site, log, environ=None,
max_http_version=max_http_version, protocol=protocol, max_http_version=max_http_version, protocol=protocol,
minimum_chunk_size=minimum_chunk_size) minimum_chunk_size=minimum_chunk_size)
if max_size is None: if max_size is None:
max_size = DEFAULT_MAX_SIMULTANEOUS_REQUESTS max_size = DEFAULT_MAX_SIMULTANEOUS_REQUESTS
......
...@@ -8,4 +8,4 @@ if __name__=='__main__': ...@@ -8,4 +8,4 @@ if __name__=='__main__':
c.execute('delete from testresult where changeset glob "*+"') c.execute('delete from testresult where changeset glob "*+"')
c.commit() c.commit()
...@@ -151,7 +151,7 @@ class TestUnlink(greentest.TestCase): ...@@ -151,7 +151,7 @@ class TestUnlink(greentest.TestCase):
assert len(p._links)==1, p._links assert len(p._links)==1, p._links
p.unlink(getcurrent()) p.unlink(getcurrent())
assert not p._links, p._links assert not p._links, p._links
g = gevent.Greenlet() g = gevent.Greenlet()
link(g) link(g)
assert len(p._links)==1, p._links assert len(p._links)==1, p._links
......
...@@ -40,7 +40,7 @@ class BoundTestCase(greentest.TestCase): ...@@ -40,7 +40,7 @@ class BoundTestCase(greentest.TestCase):
self.check_refused() self.check_refused()
def print_netstat(self, comment=''): def print_netstat(self, comment=''):
cmd ='sudo netstat -anp | grep %s' % self.port cmd ='sudo netstat -anp | grep %s' % self.port
print cmd, ' # %s' % comment print cmd, ' # %s' % comment
os.system(cmd) os.system(cmd)
...@@ -157,14 +157,14 @@ class TestSendReplyLater(BoundTestCase): ...@@ -157,14 +157,14 @@ class TestSendReplyLater(BoundTestCase):
# class TestSendReplyStartChunk(BoundTestCase): # class TestSendReplyStartChunk(BoundTestCase):
# spawn = True # spawn = True
# #
# def handle(self, r): # def handle(self, r):
# r.send_reply_start(200, 'OK') # r.send_reply_start(200, 'OK')
# gevent.sleep(0.2) # gevent.sleep(0.2)
# print 'handler sending chunk' # print 'handler sending chunk'
# r.send_reply_chunk('hi') # r.send_reply_chunk('hi')
# print 'handler done' # print 'handler done'
# #
# def test(self): # def test(self):
# response = urlopen(self.url) # response = urlopen(self.url)
# print 'connected to %s' % self.url # print 'connected to %s' % self.url
...@@ -179,7 +179,7 @@ class TestSendReplyLater(BoundTestCase): ...@@ -179,7 +179,7 @@ class TestSendReplyLater(BoundTestCase):
# print 123 # print 123
# gevent.sleep(0.5) # gevent.sleep(0.5)
# print 1234 # print 1234
# #
# def test_client_closes(self): # def test_client_closes(self):
# s = self.connect() # s = self.connect()
# s.sendall('GET / HTTP/1.0\r\n\r\n') # s.sendall('GET / HTTP/1.0\r\n\r\n')
......
...@@ -142,7 +142,7 @@ class PoolBasicTests(greentest.TestCase): ...@@ -142,7 +142,7 @@ class PoolBasicTests(greentest.TestCase):
result = p.apply(lambda a: ('foo', a), (1, )) result = p.apply(lambda a: ('foo', a), (1, ))
self.assertEqual(result, ('foo', 1)) self.assertEqual(result, ('foo', 1))
# #
# tests from standard library test/test_multiprocessing.py # tests from standard library test/test_multiprocessing.py
class TimingWrapper(object): class TimingWrapper(object):
......
...@@ -14,4 +14,4 @@ class AmazonHTTPSTests(unittest.TestCase): ...@@ -14,4 +14,4 @@ class AmazonHTTPSTests(unittest.TestCase):
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment