Pyrite is a Python 1.5 package, which means that it is a collection of many modules organized into a directory tree. Pyrite is normally installed on Python's search path under a directory called PDA/Palm, which means that the base of the package is named PDA.Palm. Because of how Python module naming works, you must append this prefix when importing parts of Pyrite; for brevity, it is omitted from module names in the rest of the documentation. For example, if this manual tells you to import the App.Address module, your code will actually have to contain a statement like "import PDA.Palm.App.Address".
The top level of the Pyrite module tree contains the core functionality which all applications and plug-ins use. It includes the following modules, as of version 0.6.0:
Definitions of the Block classes, which represent individual parts of a database, and functions useful when translating to and from the data formats used on the handheld.
Configuration file and registry support.
Database type registry, allowing application specific Block and Database support to be used automatically.
Core code, imported when you import PDA.Palm; database and handheld communication support.
Typing and validation of user-specified options.
Contains the base class and common behavior for all plug-ins.
Debugging aids.
Utility functions which deal with pdb/prc files and collections.
Contains a class which can be used to read and write pdb/prc files in pure Python.
Important: This module is incomplete and not fully tested.
Below the top level package, Pyrite contains several subpackages, each containing one or more related modules:
A collection of plug-ins, each of which provides support for a specific handheld application and its data formats.
Note: The modules in the App package do not actually adhere to the plug-in interface yet, but this will change in an upcoming release.
A collection of plug-ins, each of which is meant to be a self-contained conduit run during a synchronization session.
A collection of plug-ins, each of which converts between Pyrite Block objects and external data formats.
A collection of plug-ins, each of which provides access to databases in a particular storage location (on the handheld, on the local disk, etc.).
Common graphical user interface tasks, implemented for the standard Tkinter package.
Utility functions and programs. Most of the modules in this subpackage are actually meant to be used as command-line utilities, but some are useful when imported as well.
By convention, most subpackages (especially those which include plug-ins) contain a module of the same name, which contains the core code shared by the other modules in that package. This same-named module is imported automatically when you import the package itself. For example, if you import the Conduit package without specifying one of the modules it contains, it is actually the file Conduit/Conduit.py which is imported.
In addition to the Python modules described above, Pyrite includes two compiled C modules: _pdapalm and _Doc. The former is an interface to portions of the pilot-link library, and the latter does compression and decompression of Doc e-text records.
To allow one copy of Pyrite to be shared among multiple platforms, the compiled modules are placed in a platform-specific directory.
Tip: The platform specific directory is appended to the main package's __path__, meaning that you can import the correct version of a compiled module without specifying a platform name.
The name of this directory is the value of the interpreter's sys.platform variable, with 'plat-' appeneded to it. For example, on my system it is called plat-linux2.