Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | __repr__ |
def | __getattr__ |
def | __getitem__ |
def | getvalue |
def | getfirst |
def | getlist |
def | keys |
def | has_key |
def | __len__ |
def | read_urlencoded |
def | read_multi |
def | read_single |
def | read_binary |
def | read_lines |
def | read_lines_to_eof |
def | read_lines_to_outerboundary |
def | skip_lines |
def | make_file |
Data Fields | |
keep_blank_values | |
strict_parsing | |
fp | |
headers | |
outerboundary | |
disposition | |
disposition_options | |
name | |
filename | |
type | |
type_options | |
innerboundary | |
length | |
list | |
file | |
done | |
Static Public Attributes | |
FieldStorageClass = None | |
int | bufsize = 8 |
Store a sequence of fields, reading multipart/form-data. This class provides naming, typing, files stored on disk, and more. At the top level, it is accessible like a dictionary, whose keys are the field names. (Note: None can occur as a field name.) The items are either a Python list (if there's multiple values) or another FieldStorage or MiniFieldStorage object. If it's a single object, it has the following attributes: name: the field name, if specified; otherwise None filename: the filename, if specified; otherwise None; this is the client side filename, *not* the file name on which it is stored (that's a temporary file you don't deal with) value: the value as a *string*; for file uploads, this transparently reads the file every time you request the value file: the file(-like) object from which you can read the data; None if the data is stored a simple string type: the content-type, or None if not specified type_options: dictionary of options specified on the content-type line disposition: content-disposition, or None if not specified disposition_options: dictionary of corresponding options headers: a dictionary(-like) object (sometimes rfc822.Message or a subclass thereof) containing *all* headers The class is subclassable, mostly for the purpose of overriding the make_file() method, which is called internally to come up with a file open for reading and writing. This makes it possible to override the default choice of storing all files in a temporary directory and unlinking them as soon as they have been opened.
def __init__ | ( | self, | |
fp = None , |
|||
headers = None , |
|||
outerboundary = "" , |
|||
environ = os.environ , |
|||
keep_blank_values = 0 , |
|||
strict_parsing = 0 |
|||
) |
Constructor. Read multipart/* until last part. Arguments, all optional: fp : file pointer; default: sys.stdin (not used when the request method is GET) headers : header dictionary-like object; default: taken from environ as per CGI spec outerboundary : terminating multipart boundary (for internal use only) environ : environment dictionary; default: os.environ keep_blank_values: flag indicating whether blank values in URL encoded forms should be treated as blank strings. A true value indicates that blanks should be retained as blank strings. The default false value indicates that blank values are to be ignored and treated as if they were not included. strict_parsing: flag indicating what to do with parsing errors. If false (the default), errors are silently ignored. If true, errors raise a ValueError exception.
Definition at line 412 of file cgi.py.
def __getattr__ | ( | self, | |
name | |||
) |
Definition at line 529 of file cgi.py.
References MiniFieldStorage.file, Breakpoint.file, FieldStorage.file, fifo.list, MiniFieldStorage.list, and FieldStorage.list.
def __getitem__ | ( | self, | |
key | |||
) |
Dictionary style indexing.
Definition at line 542 of file cgi.py.
References fifo.list, MiniFieldStorage.list, and FieldStorage.list.
def __len__ | ( | self) |
def __repr__ | ( | self) |
Return a printable representation.
Definition at line 524 of file cgi.py.
References MiniFieldStorage.filename, FieldStorage.filename, MiniFieldStorage.name, FieldStorage.name, SaveVariableCondition.value, _Stop.value, Argument.value, PositiveFraction.value, ErrorDuringImport.value, Boolean.value, SaveVar.value, DateTime.value, FactionList.value, ShipTypeList.value, MiniFieldStorage.value, SetSaveVariable.value, Morsel.value, FormContent.value(), and GUIRadioButton.value.
def getfirst | ( | self, | |
key, | |||
default = None |
|||
) |
Return the first value received.
Definition at line 567 of file cgi.py.
References FieldStorage.has_key(), and FieldStorage.type.
def getlist | ( | self, | |
key | |||
) |
Return list of received values.
Definition at line 578 of file cgi.py.
References FieldStorage.has_key(), and FieldStorage.type.
def getvalue | ( | self, | |
key, | |||
default = None |
|||
) |
Dictionary style get() method, including 'value' lookup.
Definition at line 556 of file cgi.py.
References FieldStorage.has_key(), and FieldStorage.type.
def has_key | ( | self, | |
key | |||
) |
Dictionary style has_key() method.
Definition at line 598 of file cgi.py.
References fifo.list, MiniFieldStorage.list, and FieldStorage.list.
def keys | ( | self) |
Dictionary style keys() method.
Definition at line 589 of file cgi.py.
References fifo.list, MiniFieldStorage.list, and FieldStorage.list.
def make_file | ( | self, | |
binary = None |
|||
) |
Overridable: return a readable & writable file. The file will be used as follows: - data is written to it - seek(0) - data is read from it The 'binary' argument is unused -- the file is always opened in binary mode. This version opens a temporary file for reading and writing, and immediately deletes (unlinks) it. The trick (on Unix!) is that the file can still be used, but it can't be opened by another process, and it will automatically be deleted when it is closed or when the current process terminates. If you want a more permanent file, you derive a class which overrides this method. If you want a visible temporary file that is nevertheless automatically deleted when the script terminates, try defining a __del__ method in a derived class which unlinks the temporary files you have created.
Definition at line 735 of file cgi.py.
References tempfile.TemporaryFile().
def read_binary | ( | self) |
Internal: read binary data.
Definition at line 650 of file cgi.py.
References FieldStorage.bufsize, FieldStorage.done, MiniFieldStorage.file, Breakpoint.file, FieldStorage.file, FieldStorage.length, FieldStorage.make_file(), and sre_parse.min.
def read_lines | ( | self) |
Internal: read lines until EOF or outerboundary.
Definition at line 663 of file cgi.py.
References FieldStorage.__file, MiniFieldStorage.file, Breakpoint.file, FieldStorage.file, FieldStorage.make_file(), FieldStorage.outerboundary, FieldStorage.read_lines_to_eof(), and FieldStorage.read_lines_to_outerboundary().
def read_lines_to_eof | ( | self) |
Internal: read lines until EOF.
Definition at line 679 of file cgi.py.
References FieldStorage.__write(), and FieldStorage.done.
def read_lines_to_outerboundary | ( | self) |
Internal: read lines until outerboundary.
Definition at line 688 of file cgi.py.
References FieldStorage.__write(), FieldStorage.done, and FieldStorage.outerboundary.
def read_multi | ( | self, | |
environ, | |||
keep_blank_values, | |||
strict_parsing | |||
) |
Internal: read a part that is itself multipart.
Definition at line 621 of file cgi.py.
References SymbolTable.__class__, FieldStorage.FieldStorageClass, FieldStorage.fp, FieldStorage.innerboundary, fifo.list, MiniFieldStorage.list, FieldStorage.list, FieldStorage.skip_lines(), and cgi.valid_boundary().
def read_single | ( | self) |
Internal: read an atomic part.
Definition at line 639 of file cgi.py.
References FieldStorage.length, FieldStorage.read_binary(), FieldStorage.read_lines(), and FieldStorage.skip_lines().
def read_urlencoded | ( | self) |
Internal: read data in query string format.
Definition at line 610 of file cgi.py.
References FieldStorage.keep_blank_values, FieldStorage.length, fifo.list, MiniFieldStorage.list, FieldStorage.list, cgi.parse_qsl(), FieldStorage.skip_lines(), and FieldStorage.strict_parsing.
def skip_lines | ( | self) |
Internal: skip lines until outer boundary if defined.
Definition at line 716 of file cgi.py.
References FieldStorage.done, and FieldStorage.outerboundary.