Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Functions | |
def | getcaps |
def | listmailcapfiles |
def | readmailcapfile |
def | parseline |
def | parsefield |
def | findmatch |
def | lookup |
def | subst |
def | findparam |
def | test |
def | show |
Variables | |
list | __all__ = ["getcaps","findmatch"] |
Mailcap file handling. See RFC 1524.
def mailcap.findmatch | ( | caps, | |
MIMEtype, | |||
key = 'view' , |
|||
filename = "/dev/null" , |
|||
plist = [] |
|||
) |
Find a match for a mailcap entry. Return a tuple containing the command line, and the mailcap entry used; (None, None) if no match is found. This may invoke the 'test' command of several matching entries before deciding which entry to use.
Definition at line 138 of file mailcap.py.
References lookup(), and subst().
def mailcap.findparam | ( | name, | |
plist | |||
) |
Definition at line 202 of file mailcap.py.
References string.lower().
def mailcap.getcaps | ( | ) |
Return a dictionary containing the mailcap database. The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain') to a list of dictionaries corresponding to mailcap entries. The list collects all the entries for that MIME type from all available mailcap files. Each dictionary contains key-value pairs for that MIME type, where the viewing command is stored with the key "view".
Definition at line 9 of file mailcap.py.
References listmailcapfiles(), aifc.open(), and readmailcapfile().
def mailcap.listmailcapfiles | ( | ) |
def mailcap.lookup | ( | caps, | |
MIMEtype, | |||
key = None |
|||
) |
def mailcap.parsefield | ( | line, | |
i, | |||
n | |||
) |
Separate one key-value pair in a mailcap entry.
Definition at line 122 of file mailcap.py.
References string.strip().
def mailcap.parseline | ( | line) |
Parse one entry in a mailcap file and return a dictionary. The viewing command is stored as the value with the key "view", and the rest of the fields produce key-value pairs in the dict.
Definition at line 91 of file mailcap.py.
References parsefield(), and string.strip().
def mailcap.readmailcapfile | ( | fp) |
Read a mailcap file and return a dictionary keyed by MIME type. Each MIME type is mapped to an entry consisting of a list of dictionaries; the list will contain more than one such dictionary if a given MIME type appears more than once in the mailcap file. Each dictionary contains key-value pairs for that MIME type, where the viewing command is stored with the key "view".
Definition at line 53 of file mailcap.py.
References reconvert.append, dospath.join(), string.lower(), parseline(), and string.strip().
def mailcap.show | ( | caps) |
def mailcap.subst | ( | field, | |
MIMEtype, | |||
filename, | |||
plist = [] |
|||
) |
def mailcap.test | ( | ) |
list __all__ = ["getcaps","findmatch"] |
Definition at line 5 of file mailcap.py.