Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | rewindbody |
def | readheaders |
def | isheader |
def | islast |
def | iscomment |
def | getallmatchingheaders |
def | getfirstmatchingheader |
def | getrawheader |
def | getheader |
def | getheaders |
def | getaddr |
def | getaddrlist |
def | getdate |
def | getdate_tz |
def | __len__ |
def | __getitem__ |
def | __setitem__ |
def | __delitem__ |
def | get |
def | setdefault |
def | has_key |
def | keys |
def | values |
def | items |
def | __str__ |
Data Fields | |
fp | |
seekable | |
startofheaders | |
startofbody | |
dict | |
unixfrom | |
headers | |
status | |
Static Public Attributes | |
get = getheader | |
def __init__ | ( | self, | |
fp, | |||
seekable = 1 |
|||
) |
Initialize the class instance and read the headers.
Definition at line 84 of file rfc822.py.
References Message.headers.
def __getitem__ | ( | self, | |
name | |||
) |
def __len__ | ( | self) |
def __setitem__ | ( | self, | |
name, | |||
value | |||
) |
def __str__ | ( | self) |
Definition at line 466 of file rfc822.py.
References Message.headers, BaseHTTPRequestHandler.headers, MiniFieldStorage.headers, FieldStorage.headers, and HTTP.headers.
def get | ( | self, | |
name, | |||
default = "" |
|||
) |
def getaddr | ( | self, | |
name | |||
) |
def getaddrlist | ( | self, | |
name | |||
) |
Get a list of addresses from a header. Retrieves a list of addresses from a header, where each address is a tuple as returned by getaddr(). Scans all named headers, so it works properly with multiple To: or Cc: headers for example.
Definition at line 335 of file rfc822.py.
References Message.getaddr().
def getallmatchingheaders | ( | self, | |
name | |||
) |
Find all header lines matching a given header name. Look through the list of headers and find all lines matching a given header name (and their continuation lines). A list of the lines is returned, without interpretation. If the header does not occur, an empty list is returned. If the header occurs multiple times, all occurrences are returned. Case is not important in the header name.
Definition at line 227 of file rfc822.py.
def getdate | ( | self, | |
name | |||
) |
Retrieve a date field from a header. Retrieves a date field from the named header, returning a tuple compatible with time.mktime().
def getdate_tz | ( | self, | |
name | |||
) |
def getfirstmatchingheader | ( | self, | |
name | |||
) |
def getheader | ( | self, | |
name, | |||
default = None |
|||
) |
def getheaders | ( | self, | |
name | |||
) |
Get all values for a header. This returns a list of values for headers given more than once; each value in the result list is stripped in the same way as the result of getheader(). If the header is not given, return an empty list.
Definition at line 297 of file rfc822.py.
References Message.getheader().
def getrawheader | ( | self, | |
name | |||
) |
A higher-level interface to getfirstmatchingheader(). Return a string containing the literal text of the header but with the keyword stripped. All leading, trailing and embedded whitespace is kept in the string, however. Return None if the header does not occur.
Definition at line 269 of file rfc822.py.
References Message.getfirstmatchingheader().
def has_key | ( | self, | |
name | |||
) |
def iscomment | ( | self, | |
line | |||
) |
Determine whether a line should be skipped entirely. You may override this method in order to use Message parsing on tagged data in RFC 2822-like formats that support embedded comments or free-text data.
def isheader | ( | self, | |
line | |||
) |
def islast | ( | self, | |
line | |||
) |
Determine whether a line is a legal end of RFC 2822 headers. You may override this method if your application wants to bend the rules, e.g. to strip trailing whitespace, or to recognize MH template separators ('--------'). For convenience (e.g. for code reading from sockets) a line consisting of \r\n also matches.
Definition at line 208 of file rfc822.py.
def items | ( | self) |
def keys | ( | self) |
def readheaders | ( | self) |
Read header lines. Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it is never included in the returned list. The variable self.status is set to the empty string if all went well, otherwise it is an error message. The variable self.headers is a completely uninterpreted list of lines contained in the header (so printing them will reproduce the header exactly as it appears in the file).
Definition at line 120 of file rfc822.py.
References Message.headers, BaseHTTPRequestHandler.headers, MiniFieldStorage.headers, FieldStorage.headers, HTTP.headers, HTTPResponse.status, and Message.status.
def rewindbody | ( | self) |
def values | ( | self) |