Chapter 4. Handheld Application Support

Support for specific handheld applications is provided by plug-ins in a collection called App. The core code for all App plug-ins is found in the Pyrite.App module; the base class for App plug-in objects is Pyrite.App.App.

Class: App

The App class is a subclass of Pyrite.Plugin, which is a subclass of Sulfur.Plugin.

Attributes

default_name (string)

The name of the database which will be used if a name is not supplied to the open or create methods.

default_class (class object)

The class to use when opening or creating a database. The supplied class should be a subclass of, or at least exhibit the same interface as, Pyrite.Database.

default_creator (string)

The database creator ID to use if none is supplied to the create method.

default_type (string)

The database type to use if none is supplied to the create method.

default_version (integer)

The database version to use if none is supplied to the create method.

default_flags (integer)

The database flag word to use if none is supplied to the create method.

Methods

classify (info={})

Given a database header (as a dictionary, in the format used by the Database class), returns true if this plug-in has support for that database.

open (store, name=None, mode='rws', **)

Open an existing database. The supplied store must be a "live" store object, not a plug-in. The mode may include the characters r for reading, w for writing access, s to allow access to records marked "secret", and/or x for exclusive access.

Note: Some stores may not support all combinations of modes.

If no name is supplied, the value of the default_name attribute will be used. Any extra parameters supplied to open will be passed along to the store's open method.

create (store, name=None, creator=None, type=None, flags=None, version=None, **)

Create a database in the specified store, which must be a "live" store object and not a plug-in. Any parameters not supplied will be filled in with default values; extra parameters, if any, will be passed along to the store's create method.

list (store)

Returns a list of the names of all databases in the specified store (which must be a "live" store object and not a plug-in) which this plug-in is capable of handling. (The classify method is used to determine this.)

listinfo (store)

Returns a list of the headers of all databases in the specified store (which must be a "live" store object and not a plug-in) which this plug-in is capable of handling. (The classify method is used to determine this.)