summaryrefslogtreecommitdiff
path: root/wsgitools/scgi
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2008-10-14 13:48:02 +0200
committerHelmut Grohne <helmut@subdivi.de>2008-10-14 13:48:02 +0200
commit93374eaaace42da6c89663f09fcbbf2afcb3637c (patch)
tree907305447a0447a2bf9aece301d6d3f9e710c1d5 /wsgitools/scgi
parent7b46d32f7dfb63eb597d6f3ad918766d732af68d (diff)
downloadwsgitools-93374eaaace42da6c89663f09fcbbf2afcb3637c.tar.gz
added epydoc markup to doc strings
Diffstat (limited to 'wsgitools/scgi')
-rw-r--r--wsgitools/scgi/asynchronous.py18
-rw-r--r--wsgitools/scgi/forkpool.py15
2 files changed, 17 insertions, 16 deletions
diff --git a/wsgitools/scgi/asynchronous.py b/wsgitools/scgi/asynchronous.py
index 338fac9..81ed567 100644
--- a/wsgitools/scgi/asynchronous.py
+++ b/wsgitools/scgi/asynchronous.py
@@ -9,7 +9,7 @@ except ImportError:
import StringIO
class SCGIConnection(asyncore.dispatcher):
- """SCGI connection class used by WSGISCGIServer."""
+ """SCGI connection class used by L{SCGIServer}."""
# connection states
NEW = 0*4 | 1 # connection established, waiting for request
HEADER = 1*4 | 1 # the request length was received, waiting for the rest
@@ -59,15 +59,15 @@ class SCGIConnection(asyncore.dispatcher):
self.outbuff += data
def readable(self):
- """asyncore interface"""
+ """C{asyncore} interface"""
return self.state & 1 == 1
def writable(self):
- """asyncore interface"""
+ """C{asyncore} interface"""
return self.state & 2 == 2
def handle_read(self):
- """asyncore interface"""
+ """C{asyncore} interface"""
data = self.recv(self.blocksize)
self.inbuff += data
if self.state == SCGIConnection.NEW:
@@ -148,7 +148,7 @@ class SCGIConnection(asyncore.dispatcher):
return self._wsgi_write
def handle_write(self):
- """asyncore interface"""
+ """C{asyncore} interface"""
assert self.state >= SCGIConnection.REQ
if len(self.outbuff) < self.blocksize:
self._try_send_headers()
@@ -173,7 +173,7 @@ class SCGIConnection(asyncore.dispatcher):
self.outbuff = self.outbuff[sentbytes:]
def handle_close(self):
- """asyncore interface"""
+ """C{asyncore} interface"""
self.close()
__all__.append("SCGIServer")
@@ -188,9 +188,9 @@ class SCGIServer(asyncore.dispatcher):
@param port: is an int representing the TCP port number to be used.
@type interface: str
@param interface: is a string specifying the network interface to bind
- which defaults to "localhost" making the server inaccessible
+ which defaults to C{"localhost"} making the server inaccessible
over network.
- @param error: is a file-like object being passed as wsgi.error in the
+ @param error: is a file-like object being passed as C{wsgi.error} in the
environ parameter defaulting to stderr.
@type maxrequestsize: int
@param maxrequestsize: limit the size of request blocks in scgi
@@ -229,6 +229,6 @@ class SCGIServer(asyncore.dispatcher):
def run(self):
"""Runs the server. It will not return and you can invoke
- asyncore.loop() instead achieving the same effect."""
+ C{asyncore.loop()} instead achieving the same effect."""
asyncore.loop()
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py
index 3058316..0393bb1 100644
--- a/wsgitools/scgi/forkpool.py
+++ b/wsgitools/scgi/forkpool.py
@@ -1,5 +1,5 @@
"""
-The forkpool.SCGIServer adapts a wsgi application to a scgi service.
+The L{forkpool.SCGIServer} adapts a wsgi application to a scgi service.
It works with multiple processes that are periodically cleaned up to prevent
memory leaks having an impact to the system.
@@ -14,7 +14,7 @@ import errno
class SocketFileWrapper:
"""Wraps a socket to a wsgi-compliant file-like object."""
def __init__(self, sock, toread):
- """@param sock: is a socket.socket()"""
+ """@param sock: is a C{socket.socket()}"""
self.sock = sock
self.buff = ""
self.toread = toread
@@ -47,7 +47,8 @@ class SocketFileWrapper:
def close(self):
"""Does not close the socket, because it might still be needed. It
- reads all data that should have been read as given by CONTENT_LENGTH."""
+ reads all data that should have been read as given by C{CONTENT_LENGTH}.
+ """
try:
while self.toread > 0:
if self.toread > 4096:
@@ -155,8 +156,8 @@ class SocketFileWrapper:
map(self.write, lines)
class SCGIServer:
- """Usage: create an SCGIServer object and invoke the run method which will
- then turn this process into an scgi server."""
+ """Usage: create an L{SCGIServer} object and invoke the run method which
+ will then turn this process into an scgi server."""
class WorkerState:
"""state: 0 means idle and 1 means working.
These values are also sent as strings '0' and '1' over the socket."""
@@ -172,8 +173,8 @@ class SCGIServer:
@type port: int
@param port: is the tcp port to listen on
@type interface: str
- @param interface: is the interface to bind to (default: "localhost")
- @param error: is a filelike object beeing passed as wsgi.error in
+ @param interface: is the interface to bind to (default: C{"localhost"})
+ @param error: is a file-like object beeing passed as C{wsgi.error} in
environ
@type minworkers: int
@param minworkers: is the number of worker processes to spawn