summaryrefslogtreecommitdiff
path: root/eventlet
diff options
context:
space:
mode:
authorSergey Shepelev <temotor@gmail.com>2013-08-08 19:52:41 +0400
committerSergey Shepelev <temotor@gmail.com>2013-08-08 19:52:41 +0400
commitdcf0a11bc3059b892410cc8b8c7e752598f6f2e7 (patch)
tree7a70842a7aa8358cabcc43279a5118e9e258e740 /eventlet
parent30fd49f44b5e6edeff5fa45e569e91b8ad1a5841 (diff)
downloadeventlet-dcf0a11bc3059b892410cc8b8c7e752598f6f2e7.tar.gz
wsgi: pep8 whitespace
Diffstat (limited to 'eventlet')
-rw-r--r--eventlet/wsgi.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/eventlet/wsgi.py b/eventlet/wsgi.py
index 0ed4d12..59186e5 100644
--- a/eventlet/wsgi.py
+++ b/eventlet/wsgi.py
@@ -31,6 +31,7 @@ _monthname = [None, # Dummy so we can use 1-based month numbers
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+
def format_date_time(timestamp):
"""Formats a unix timestamp into an HTTP standard string."""
year, month, day, hh, mm, ss, wd, _y, _z = time.gmtime(timestamp)
@@ -38,11 +39,13 @@ def format_date_time(timestamp):
_weekdayname[wd], day, _monthname[month], year, hh, mm, ss
)
+
# Collections of error codes to compare against. Not all attributes are set
# on errno module on all platforms, so some are literals :(
BAD_SOCK = set((errno.EBADF, 10053))
BROKEN_SOCK = set((errno.EPIPE, errno.ECONNRESET))
+
# special flag return value for apps
class _AlreadyHandled(object):
@@ -54,7 +57,9 @@ class _AlreadyHandled(object):
ALREADY_HANDLED = _AlreadyHandled()
+
class Input(object):
+
def __init__(self,
rfile,
content_length,
@@ -519,8 +524,8 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
self.connection.close()
-
class Server(BaseHTTPServer.HTTPServer):
+
def __init__(self,
socket,
address,
@@ -593,6 +598,7 @@ class Server(BaseHTTPServer.HTTPServer):
def log_message(self, message):
self.log.write(message + '\n')
+
try:
import ssl
ACCEPT_EXCEPTIONS = (socket.error, ssl.SSLError)
@@ -602,6 +608,7 @@ except ImportError:
ACCEPT_EXCEPTIONS = (socket.error,)
ACCEPT_ERRNO = set((errno.EPIPE, errno.EBADF, errno.ECONNRESET))
+
def server(sock, site,
log=None,
environ=None,
@@ -617,7 +624,7 @@ def server(sock, site,
log_format=DEFAULT_LOG_FORMAT,
url_length_limit=MAX_REQUEST_LINE,
debug=True):
- """ Start up a wsgi server handling requests from the supplied server
+ """Start up a WSGI server handling requests from the supplied server
socket. This function loops forever. The *sock* object will be closed after server exits,
but the underlying file descriptor will remain open, so if you have a dup() of *sock*,
it will remain usable.