<HTML ><HEAD ><TITLE >Handheld Application Support</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.42"><LINK REL="HOME" TITLE="Pyrite Programmers Guide" HREF="book1.html"><LINK REL="UP" TITLE="Reference" HREF="p45.html"><LINK REL="PREVIOUS" TITLE="Class: BaseStore" HREF="x681.html"><LINK REL="NEXT" TITLE="Conduits" HREF="c895.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Pyrite Programmers Guide</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="x681.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="c895.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="CHAPTER" ><H1 ><A NAME="REF-APPS" >Chapter 4. Handheld Application Support</A ></H1 ><P > Support for specific handheld applications is provided by plug-ins in a collection called <TT CLASS="LITERAL" >App</TT >. The core code for all <TT CLASS="LITERAL" >App</TT > plug-ins is found in the <TT CLASS="CLASSNAME" >Pyrite.App</TT > module; the base class for <TT CLASS="LITERAL" >App</TT > plug-in objects is <TT CLASS="CLASSNAME" >Pyrite.App.App</TT >. </P ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="REF-APPS-APP" >Class: App</A ></H1 ><P > The <TT CLASS="CLASSNAME" >App</TT > class is a subclass of <TT CLASS="CLASSNAME" >Pyrite.Plugin</TT >, which is a subclass of <TT CLASS="CLASSNAME" >Sulfur.Plugin</TT >. </P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="REF-APPS-APP-ATTRIBUTES" >Attributes</A ></H2 ><P ></P ><DL ><DT ><TT CLASS="STRUCTFIELD" ><I >default_name</I ></TT > (<SPAN CLASS="TYPE" >string</SPAN >)</DT ><DD ><P >The name of the database which will be used if a name is not supplied to the <TT CLASS="FUNCTION" >open</TT > or <TT CLASS="FUNCTION" >create</TT > methods.</P ></DD ><DT ><TT CLASS="STRUCTFIELD" ><I >default_class</I ></TT > (<SPAN CLASS="TYPE" >class object</SPAN >)</DT ><DD ><P >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, <TT CLASS="CLASSNAME" >Pyrite.Database</TT >.</P ></DD ><DT ><TT CLASS="STRUCTFIELD" ><I >default_creator</I ></TT > (<SPAN CLASS="TYPE" >string</SPAN >)</DT ><DD ><P >The database creator ID to use if none is supplied to the <TT CLASS="FUNCTION" >create</TT > method.</P ></DD ><DT ><TT CLASS="STRUCTFIELD" ><I >default_type</I ></TT > (<SPAN CLASS="TYPE" >string</SPAN >)</DT ><DD ><P >The database type to use if none is supplied to the <TT CLASS="FUNCTION" >create</TT > method.</P ></DD ><DT ><TT CLASS="STRUCTFIELD" ><I >default_version</I ></TT > (<SPAN CLASS="TYPE" >integer</SPAN >)</DT ><DD ><P >The database version to use if none is supplied to the <TT CLASS="FUNCTION" >create</TT > method.</P ></DD ><DT ><TT CLASS="STRUCTFIELD" ><I >default_flags</I ></TT > (<SPAN CLASS="TYPE" >integer</SPAN >)</DT ><DD ><P >The database flag word to use if none is supplied to the <TT CLASS="FUNCTION" >create</TT > method.</P ></DD ></DL ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="REF-APPS-APP-METHODS" >Methods</A ></H2 ><P ></P ><DL ><DT ><TT CLASS="FUNCTION" >classify</TT > (<TT CLASS="PARAMETER" ><I >info</I ></TT >={})</DT ><DD ><P >Given a database header (as a dictionary, in the format used by the <TT CLASS="CLASSNAME" >Database</TT > class), returns true if this plug-in has support for that database.</P ></DD ><DT ><TT CLASS="FUNCTION" >open</TT > (<TT CLASS="PARAMETER" ><I >store</I ></TT >, <TT CLASS="PARAMETER" ><I >name</I ></TT >=None, <TT CLASS="PARAMETER" ><I >mode</I ></TT >='rws', <TT CLASS="PARAMETER" ><I >**</I ></TT >)</DT ><DD ><P >Open an existing database. The supplied <TT CLASS="PARAMETER" ><I >store</I ></TT > must be a "live" store object, not a plug-in. The <TT CLASS="PARAMETER" ><I >mode</I ></TT > may include the characters <TT CLASS="LITERAL" >r</TT > for reading, <TT CLASS="LITERAL" >w</TT > for writing access, <TT CLASS="LITERAL" >s</TT > to allow access to records marked "secret", and/or <TT CLASS="LITERAL" >x</TT > for exclusive access. </P ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >Note: </B >Some stores may not support all combinations of modes.</P ></BLOCKQUOTE ></DIV ><P >If no name is supplied, the value of the <TT CLASS="STRUCTFIELD" ><I >default_name</I ></TT > attribute will be used. Any extra parameters supplied to <TT CLASS="FUNCTION" >open</TT > will be passed along to the store's <TT CLASS="FUNCTION" >open</TT > method.</P ></DD ><DT ><TT CLASS="FUNCTION" >create</TT > (<TT CLASS="PARAMETER" ><I >store</I ></TT >, <TT CLASS="PARAMETER" ><I >name</I ></TT >=None, <TT CLASS="PARAMETER" ><I >creator</I ></TT >=None, <TT CLASS="PARAMETER" ><I >type</I ></TT >=None, <TT CLASS="PARAMETER" ><I >flags</I ></TT >=None, <TT CLASS="PARAMETER" ><I >version</I ></TT >=None, <TT CLASS="PARAMETER" ><I >**</I ></TT >)</DT ><DD ><P >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 <TT CLASS="FUNCTION" >create</TT > method.</P ></DD ><DT ><TT CLASS="FUNCTION" >list</TT > (<TT CLASS="PARAMETER" ><I >store</I ></TT >)</DT ><DD ><P >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 <TT CLASS="FUNCTION" >classify</TT > method is used to determine this.)</P ></DD ><DT ><TT CLASS="FUNCTION" >listinfo</TT > (<TT CLASS="PARAMETER" ><I >store</I ></TT >)</DT ><DD ><P >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 <TT CLASS="FUNCTION" >classify</TT > method is used to determine this.)</P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="x681.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="c895.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Class: BaseStore</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="p45.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Conduits</TD ></TR ></TABLE ></DIV ></BODY ></HTML >