Lines Matching defs:file
69 logfp = None # File object to log to, if not None
72 """Write a log message, if there is a log file.
76 (initially), to dolog (once the log file has been opened), or to
82 will write "a: b" to the log file, followed by a newline.
84 If the global logfp is not None, it should be a file object to
88 giving a filename to open, in append mode. This file should be
89 world writable!!! If the file can't be opened, logging is
107 """Write a log message to the log file. See initlog() for docs."""
125 """Parse a query in the environment or from a file (default stdin)
129 fp : file pointer; default: sys.stdin
197 fp : input file
329 """Like FieldStorage, for use when no file uploads are possible."""
335 file = None
345 # self.file = StringIO(value)
366 client side filename, *not* the file name on which it is
367 stored (that's a temporary file you don't deal with)
369 value: the value as a *string*; for file uploads, this
370 transparently reads the file every time you request the value
372 file: the file(-like) object from which you can read the data;
389 a file open for reading and writing. This makes it possible to
401 fp : file pointer; default: sys.stdin
502 self.list = self.file = None
522 if self.file:
523 self.file.seek(0)
524 value = self.file.read()
525 self.file.seek(0)
647 self.file.seek(0)
649 bufsize = 8*1024 # I/O buffering size for copy to file
653 self.file = self.make_file('b')
661 self.file.write(data)
666 self.file = self.__file = StringIO()
675 self.file = self.make_file('')
676 self.file.write(self.__file.getvalue())
678 self.file.write(line)
743 """Overridable: return a readable & writable file.
745 The file will be used as follows:
750 The 'binary' argument is unused -- the file is always opened
753 This version opens a temporary file for reading and writing,
755 that the file can still be used, but it can't be opened by
759 If you want a more permanent file, you derive a class which
760 overrides this method. If you want a visible temporary file
1048 # Call test() when this file is run as a script (not imported as a module)