class documentation

class twisted.web.twcgi.CGIScript(resource.Resource): (source)

Known subclasses: twisted.web.twcgi.FilteredScript

View In Hierarchy

CGIScript is a resource which runs child processes according to the CGI specification.

The implementation is complex due to the fact that it requires asynchronous IPC with an external process with an unpleasant protocol.

Class Variable isLeaf Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
Method __init__ Initialize, with the name of a CGI script file.
Instance Variable filename Undocumented
Method render Do various things to conform to the CGI specification.
Method runProcess Run the cgi script.
Instance Variable _reactor Undocumented

Inherited from Resource:

Class Variable server Undocumented
Instance Variable children Undocumented
Method listStaticNames Undocumented
Method listStaticEntities Undocumented
Method listNames Undocumented
Method listEntities Undocumented
Method listDynamicNames Undocumented
Method listDynamicEntities Undocumented
Method getStaticEntity Undocumented
Method getDynamicEntity Undocumented
Method delEntity Undocumented
Method reallyPutEntity Undocumented
Method getChild Retrieve a 'child' resource from me.
Method getChildWithDefault Retrieve a static or dynamically generated child resource from me.
Method getChildForRequest Undocumented
Method putChild Register a static child.
Method render_HEAD Default handling of HEAD method.
isLeaf = (source)

Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.

(type: int)
def __init__(self, filename, registry=None, reactor=None): (source)

Initialize, with the name of a CGI script file.

filename = (source)

Undocumented

_reactor = (source)

Undocumented

def render(self, request): (source)

Do various things to conform to the CGI specification.

I will set up the usual slew of environment variables, then spin off a process.

ParametersrequestAn HTTP request. (type: twisted.web.http.Request)
def runProcess(self, env, request, qargs=[]): (source)

Run the cgi script.

ParametersenvThe environment variables to pass to the process that will get spawned. See twisted.internet.interfaces.IReactorProcess.spawnProcess for more information about environments and process creation. (type: A dict of str, or None)
requestAn HTTP request. (type: twisted.web.http.Request)
qargsThe command line arguments to pass to the process that will get spawned. (type: A list of str)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.