rox.mime
index

This module provides access to the shared MIME database.
 
types is a dictionary of all known MIME types, indexed by the type name, e.g.
types['application/x-python']
 
Applications can install information about MIME types by storing an
XML file as <MIME>/packages/<application>.xml and running the
update-mime-database command, which is provided by the freedesktop.org
shared mime database package.
 
See http://www.freedesktop.org/standards/shared-mime-info-spec/ for
information about the format of these files.

 
Classes
       
MIMEtype

 
class MIMEtype
      Type holding data about a MIME type
 
  Methods defined here:
__init__(self, media, subtype)
Don't use this constructor directly; use mime.lookup() instead.
get_comment(self)
Returns comment for current language, loading it if needed.

 
Functions
       
get_type(path, follow=1, name_pri=100)
Returns type of file indicated by path.
path     - pathname to check (need not exist)
follow   - when reading file, follow symbolic links
name_pri - Priority to do name matches.  100=override magic
get_type_by_name(path)
Returns type of file by its name, or None if not known
install_mime_info(application, package_file=None)
Copy 'package_file' as ~/.local/share/mime/packages/<application>.xml.
If package_file is None, install <app_dir>/<application>.xml.
If already installed, does nothing. May overwrite an existing
file with the same name (if the contents are different)
lookup(media, subtype=None)
Get the MIMEtype object for this type, creating a new one if needed.
test(name)
Print results for name.  Test routine