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">
<html xmlns="http://www.w3.org/1999/xhtml">
<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>
<link rel="stylesheet" href="{{ MEDIA_URL }}chat.css" type="text/css"/>
</head>
......
......@@ -7,7 +7,7 @@ urlpatterns = patterns('webchat.chat.views',
('^a/message/updates$', 'message_updates'))
urlpatterns += patterns('django.views.static',
(r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'),
(r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'),
'serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True }))
......
......@@ -120,7 +120,7 @@ def backdoor((conn, addr), locals=None):
class _fileobject(socket._fileobject):
def write(self, data):
self._sock.sendall(data)
......
......@@ -117,7 +117,7 @@ class AsyncResult(object):
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`
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
those made in the future) will return the value:
......
......@@ -102,11 +102,10 @@ class HTTPServer(object):
requests = self._requests.get(request.connection._obj)
if requests is not None:
requests.remove(request)
def _cb_request(self, request):
try:
spawn = self.spawn
# we're setting the callback here anyway, because
request.connection.set_closecb(self)
self._requests.setdefault(request.connection._obj, []).append(request)
if spawn is None:
......
......@@ -188,7 +188,7 @@ class Hub(greenlet):
class DispatchExit(Exception):
def __init__(self, code):
self.code = code
Exception.__init__(self, code)
......
......@@ -10,7 +10,7 @@ __all__ = ['GreenletSet', 'Pool']
class GreenletSet(object):
"""Maintain a set of greenlets that are still running.
Links to each item and removes it upon notification.
"""
greenlet_class = Greenlet
......@@ -164,7 +164,7 @@ class GreenletSet(object):
g.rawlink(q.put)
for _ in xrange(len(greenlets)):
yield q.get().get()
def full(self):
return False
......
......@@ -131,7 +131,7 @@ class Input(object):
class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
protocol_version = 'HTTP/1.1'
minimum_chunk_size = MINIMUM_CHUNK_SIZE
def handle_one_request(self):
if self.server.max_http_version:
self.protocol_version = self.server.max_http_version
......@@ -381,10 +381,10 @@ class Server(BaseHTTPServer.HTTPServer):
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):
serv = Server(sock, sock.getsockname(), site, log, environ=None,
max_http_version=max_http_version, protocol=protocol,
serv = Server(sock, sock.getsockname(), site, log, environ=None,
max_http_version=max_http_version, protocol=protocol,
minimum_chunk_size=minimum_chunk_size)
if max_size is None:
max_size = DEFAULT_MAX_SIMULTANEOUS_REQUESTS
......
......@@ -8,4 +8,4 @@ if __name__=='__main__':
c.execute('delete from testresult where changeset glob "*+"')
c.commit()
......@@ -151,7 +151,7 @@ class TestUnlink(greentest.TestCase):
assert len(p._links)==1, p._links
p.unlink(getcurrent())
assert not p._links, p._links
g = gevent.Greenlet()
link(g)
assert len(p._links)==1, p._links
......
......@@ -40,7 +40,7 @@ class BoundTestCase(greentest.TestCase):
self.check_refused()
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
os.system(cmd)
......@@ -157,14 +157,14 @@ class TestSendReplyLater(BoundTestCase):
# class TestSendReplyStartChunk(BoundTestCase):
# spawn = True
#
#
# def handle(self, r):
# r.send_reply_start(200, 'OK')
# gevent.sleep(0.2)
# print 'handler sending chunk'
# r.send_reply_chunk('hi')
# print 'handler done'
#
#
# def test(self):
# response = urlopen(self.url)
# print 'connected to %s' % self.url
......@@ -179,7 +179,7 @@ class TestSendReplyLater(BoundTestCase):
# print 123
# gevent.sleep(0.5)
# print 1234
#
#
# def test_client_closes(self):
# s = self.connect()
# s.sendall('GET / HTTP/1.0\r\n\r\n')
......
......@@ -142,7 +142,7 @@ class PoolBasicTests(greentest.TestCase):
result = p.apply(lambda a: ('foo', a), (1, ))
self.assertEqual(result, ('foo', 1))
#
#
# tests from standard library test/test_multiprocessing.py
class TimingWrapper(object):
......
......@@ -14,4 +14,4 @@ class AmazonHTTPSTests(unittest.TestCase):
if __name__ == "__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