Package AccessGrid :: Module AppDb :: Class AppDb
[show private | hide private]
[frames | no frames]

Class AppDb


The AppDb class provides an interface for the Toolkit to store information on a per user basis about what applications are installed and how to run them.


Method Summary
  __init__(self, path, filename)
The constructor for the AppDb, it uses a file for persistent storage.
  AddCommand(self, mimeType, cmdName, cmdString)
returns a tuple (int, string).
  AddMimeType(self, name, extension, mimeType, startable)
returns a tuple of (int, string).
  GetCommandLine(self, mimeType, cmdName, vars)
returns a string containing the commandline used to execute the viewer, optionally if vars is a dictionary, of name = value, named parameter substitution is done for the command line.
  GetCommandNames(self, mimeType)
returns a list of command names for this mime type.
  GetCommands(self, mimeType)
returns a dict of [commandname:command] for this mimetype
  GetExtForMimeType(self, mimeType)
returns a extension in a string.
  GetMimeType(self, name, extension)
Find a mimetype for the specified app name or extension.
  GetNameForMimeType(self, mimeType)
returns a name in a string.
  ListApplications(self)
  ListAppsAsAppDescriptions(self)
  ListMimeTypes(self)
  Load(self, fileName)
Load the app db from the file it's stored in.
  RegisterApplication(self, name, mimeType, extension, commandDict, fileList, srcPath, dstPath, startable)
Encapsulate all the actions required to register a new application.
  RemoveCommand(self, mimeType, cmdName)
returns a tuple (int, string).
  RemoveMimeType(self, name, extension, mimeType)
returns a tuple of (int, string).
  UnregisterApplication(self, name, mimeType, extension)
Encapsulate all the actions required to unregister an application.
  _Flush(self)
Flush the current db out to file storage.
  _GetNiceName(self, pName)
Get a user friendly name for a private name.
  _GetNiceVerb(self, pVerb)
Get a user friendly name for a private verb.
  _GetPrivName(self, name)
Look up the private name for the exposed name.
  _GetPrivVerb(self, verb, mimeType)
Look up the private verb for the exposed verb.
  _Synch(self)
Synch the in-memory app db with the file, if necessary
  _UpdateModTime(self)
Update the last modified time of the appdb file

Class Variable Summary
str defaultSeparator = ':'

Method Details

__init__(self, path=None, filename='ApplicationDatabase')
(Constructor)

The constructor for the AppDb, it uses a file for persistent storage.

AddCommand(self, mimeType, cmdName, cmdString)

returns a tuple (int, string). Success is (1, cmdName), failure is (0, reason).

AddMimeType(self, name, extension, mimeType, startable='1')

returns a tuple of (int, string). Success is (1, mimeType), failure is (0, reason)

GetCommandLine(self, mimeType, cmdName, vars=None)

returns a string containing the commandline used to execute the viewer, optionally if vars is a dictionary, of name = value, named parameter substitution is done for the command line.

GetCommandNames(self, mimeType)

returns a list of command names for this mime type.

GetCommands(self, mimeType)

returns a dict of [commandname:command] for this mimetype

GetExtForMimeType(self, mimeType)

returns a extension in a string.

GetMimeType(self, name=None, extension=None)

Find a mimetype for the specified app name or extension.

returns a mimeType in a string.

GetNameForMimeType(self, mimeType)

returns a name in a string.

Load(self, fileName=None)

Load the app db from the file it's stored in.

RegisterApplication(self, name, mimeType, extension, commandDict, fileList, srcPath, dstPath, startable='1')

Encapsulate all the actions required to register a new application. returns 0 on failure, 1 on success

RemoveCommand(self, mimeType, cmdName)

returns a tuple (int, string). Success is (1, cmdName), failure is (0, reason).

RemoveMimeType(self, name=None, extension=None, mimeType=None)

returns a tuple of (int, string). Success is (1, mimeType), failure is (0, reason)

UnregisterApplication(self, name=None, mimeType=None, extension=None)

Encapsulate all the actions required to unregister an application. returns 0 on failure, 1 on success

_Flush(self)

Flush the current db out to file storage.

_GetNiceName(self, pName)

Get a user friendly name for a private name.

_GetNiceVerb(self, pVerb)

Get a user friendly name for a private verb.

_GetPrivName(self, name)

Look up the private name for the exposed name.

returns name as string or None

_GetPrivVerb(self, verb, mimeType)

Look up the private verb for the exposed verb.

_Synch(self)

Synch the in-memory app db with the file, if necessary

_UpdateModTime(self)

Update the last modified time of the appdb file


Class Variable Details

defaultSeparator

Type:
str
Value:
':'                                                                    

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