Lines Matching refs:file
66 """Write a log message, if there is a log file.
70 (initially), to dolog (once the log file has been opened), or to
76 will write "a: b" to the log file, followed by a newline.
78 If the global logfp is not None, it should be a file object to
82 giving a filename to open, in append mode. This file should be
83 world writable!!! If the file can't be opened, logging is
103 """Write a log message to the log file. See initlog() for docs."""
111 """Close the log file."""
131 """Parse a query in the environment or from a file (default stdin)
135 fp : file pointer; default: sys.stdin.buffer
203 fp : input file
209 value is a list of values for that field. For non-file fields, the value
264 """Like FieldStorage, for use when no file uploads are possible."""
270 file = None
280 # self.file = StringIO(value)
301 client side filename, *not* the file name on which it is
302 stored (that's a temporary file you don't deal with)
304 value: the value as a *string*; for file uploads, this
305 transparently reads the file every time you request the value
308 file: the file(-like) object from which you can read the data *as
325 a file open for reading and writing. This makes it possible to
338 fp : file pointer; default: sys.stdin.buffer
420 raise TypeError("fp must be file pointer")
486 self.list = self.file = None
497 self.file.close()
505 self.file.close()
518 if self.file:
519 self.file.seek(0)
520 value = self.file.read()
521 self.file.seek(0)
634 # Ensure that we consume the file until we've hit our inner boundary
690 self.file.seek(0)
692 bufsize = 8*1024 # I/O buffering size for copy to file
696 self.file = self.make_file()
708 self.file.write(data)
714 self.file = self.__file = BytesIO() # store data as bytes for files
716 self.file = self.__file = StringIO() # as strings for other fields
726 self.file = self.make_file()
728 self.file.write(data)
732 self.file.write(line)
735 self.file.write(line.decode(self.encoding, self.errors))
820 """Overridable: return a readable & writable file.
822 The file will be used as follows:
827 The file is opened in binary mode for files, in text mode
830 This version opens a temporary file for reading and writing,
832 that the file can still be used, but it can't be opened by
836 If you want a more permanent file, you derive a class which
837 overrides this method. If you want a visible temporary file
1010 # Call test() when this file is run as a script (not imported as a module)