Package AccessGrid :: Package Platform :: Package win32 :: Module Config :: Class MimeConfig
[show private | hide private]
[frames | no frames]

Class MimeConfig

MimeConfig --+
             |
            MimeConfig


The MimeConfig object encapsulates in single object the management of mime types. This provides a cross platform solution so the AGTk can leverage legacy configuration and applications for data viewing.
Method Summary
  __init__(self)
  GetMimeCommands(self, mimeType, ext)
This gets the mime commands from one of the three types of specifiers windows knows about.
  GetMimeType(self, extension)
  instance()
(Static method)
  RegisterMimeType(self, mimeType, extension, fileType, description, cmds)
mimeType - mimetype designator extension - file extension (doesn't have to be 3 letters, does have to start with a .) fileType - file type, doesn't matter, just unique description - free form description of the type

Class Variable Summary
NoneType theMimeConfigInstance = None                                                                  

Instance Method Details

GetMimeCommands(self, mimeType=None, ext=None)

This gets the mime commands from one of the three types of specifiers windows knows about. Depending on which is passed in the following trail of information is retrieved:
  1. "HKCR\MIME\Database\Content Type" contains subkeys for all known MIME types, each key has a string value "Extension" which gives (dot preceded) extension for the files of this MIME type.
  2. "HKCR\.ext" contains

    a) unnamed value containing the "filetype"

    b) value "Content Type" containing the MIME type
  3. "HKCR iletype" contains

    a) unnamed value containing the description

    b) subkey "DefaultIcon" with single unnamed value giving the icon index in an icon file

    c) shell\open\command and shell\open\print subkeys containing the commands to open/print the file (the positional parameters are introduced by %1, %2, ... in these strings, we change them to %s ourselves)
Overrides:
AccessGrid.Config.MimeConfig.GetMimeCommands

RegisterMimeType(self, mimeType, extension, fileType, description, cmds)

mimeType - mimetype designator extension - file extension (doesn't have to be 3 letters, does have to start with a .) fileType - file type, doesn't matter, just unique description - free form description of the type

list of: verb - name of command command - the actual command line commandDesc - a description (menu format) for the command example: [ (verb,command,commandDesc), ... ]

----

This function gets the mime type registered with windows via the registry.

The following documentation is from wxWindows, src/msw/mimetype.cpp:
  1. "HKCR\MIME\Database\Content Type" contains subkeys for all known MIME types, each key has a string value "Extension" which gives (dot preceded) extension for the files of this MIME type.
  2. "HKCR\.ext" contains

    a) unnamed value containing the "filetype"

    b) value "Content Type" containing the MIME type
  3. "HKCR iletype" contains

    a) unnamed value containing the description

    b) subkey "DefaultIcon" with single unnamed value giving the icon index in an icon file

    c) shell\open\command and shell\open\print subkeys containing the commands to open/print the file (the positional parameters are introduced by %1, %2, ... in these strings, we change them to %s ourselves)
Overrides:
AccessGrid.Config.MimeConfig.RegisterMimeType

Class Variable Details

theMimeConfigInstance

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Thu Apr 14 16:39:27 2005 http://epydoc.sf.net