| |
- copyfile(self, source, outputfile)
- Copy all data between two file objects.
- The SOURCE argument is a file object open for reading
- (or anything with a read() method) and the DESTINATION
- argument is a file object open for writing (or
- anything with a write() method).
- The only reason for overriding this would be to change
- the block size or perhaps to replace newlines by CRLF
- -- note however that this the default server uses this
- to copy binary data as well.
- do_GET(self)
- Serve a GET request.
- do_HEAD(self)
- Serve a HEAD request.
- guess_type(self, path)
- Guess the type of a file.
- Argument is a PATH (a filename).
- Return value is a string of the form type/subtype,
- usable for a MIME Content-type header.
- The default implementation looks the file's extension
- up in the table self.extensions_map, using text/plain
- as a default; however it would be permissible (if
- slow) to look inside the data to make a better guess.
- send_head(self)
- 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.
- translate_path(self, path)
- Translate a /-separated PATH to the local filename syntax.
- Components that mean special things to the local file system
- (e.g. drive or directory names) are ignored. (XXX They should
- probably be diagnosed.)
|