twisted.web.httpView Source (View In Hierarchy)
Known subclasses: twisted.web.server.Site
Factory for HTTP server.
|Method||buildProtocol||Create an instance of a subclass of Protocol.|
|Method||startFactory||Set up request logging if necessary.|
|Method||stopFactory||This will be called before I stop listening on all Ports/Connectors.|
|Method||log||Write a line representing
|Instance Variable||_logDateTime||A cached datetime string for log messages, updated by
|Instance Variable||_logDateTimeCall||A delayed call for the next update to the cached log datetime string. (type:
|Instance Variable||_logFormatter||See the
|Instance Variable||_nativeize||A flag that indicates whether the log file being written to wants native
|Method||_updateLogDateTime||Update log datetime periodically, so we aren't always recalculating it.|
|Method||_openLogFile||Override in subclasses, e.g. to use
|Class Method||forProtocol||Create a factory for the given protocol.|
|Method||logPrefix||Describe this factory for log messages.|
|Method||doStart||Make sure startFactory is called.|
|Method||doStop||Make sure stopFactory is called.|
True) or bytes (
False). This is only to support writing to
twisted.python.logwhich, unfortunately, works with native strings.
IReactorTimeprovider used to compute logging timestamps.
|Parameters||logPath||File path to which access log messages will be written or |
|timeout||The initial value of |
|logFormatter||An object to format requests into log lines for the access log. |
Update log datetime periodically, so we aren't always recalculating it.
Create an instance of a subclass of Protocol.
The returned instance will handle input on an incoming server connection, and an attribute "factory" pointing to the creating factory.
may be returned to immediately close the new connection.
Override this method to alter how Protocol instances get created.
|Parameters||addr||an object implementing |
Set up request logging if necessary.
This will be called before I stop listening on all Ports/Connectors.
This can be overridden to perform 'shutdown' tasks such as disconnecting database connections, closing files, etc.
It will be called, for example, before an application shuts down, if it was connected to a port. User code should not call this function directly.