sugar4.network
STABLE.
Classes
GlibTCPServer |
|
RequestHandler class that integrates with Glib mainloop. It writes |
|
Grabs a URL in chunks, returning to the mainloop after each chunk |
Functions
Module Contents
- class sugar4.network.GlibTCPServer(server_address, RequestHandlerClass)[source]
Bases:
six.moves.socketserver.TCPServerGlibTCPServer
Integrate socket accept into glib mainloop.
Constructor. May be extended, do not override.
- class sugar4.network.ChunkedGlibHTTPRequestHandler(request, client_address, server)[source]
Bases:
six.moves.SimpleHTTPServer.SimpleHTTPRequestHandlerRequestHandler class that integrates with Glib mainloop. It writes the specified file to the client in chunks, returning control to the mainloop between chunks.
- send_head()[source]
Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied to the outputfile by the caller unless the command was HEAD, and must be closed by the caller under all circumstances), or None, in which case the caller has nothing further to do.
** [dcbw] modified to send Content-disposition filename too