
This is an experimental piece of code to interface Python to the pilot-link
library. To use it, you will have to figure out how to link and install the
.c file so that your Python installation can use it. The included Makefile
will probably only work for ELF systems.

(Note that I have only tested this with Python 1.4, and have no particular
expectation of it working with earlier or later versions.)

Usage notes:

	Start with 'importing pdapilot'.
	
	Look at test.py for examples of simple usage.
	
Documentation (such as it is):	
	
	pdapilot.OpenPort(device): Open a device, ready for Accept
		
		returns a file descriptor which may be used to access the given device
		(serial port) with the Accept routine.
		
		This routine is built out of Socket, Bind, & Listen.

	pdapilot.Socket(domain,type,protocol): returns a new pilot socket.

	pdapilot.Bind(socket, address): binds a socket to the given address.

	pdapilot.Listen(socket, backup):
	
	pdapilot.Accept(socket): Waits for incoming Pilot connection
	
		returns a new pdapilot.dlp object if a connection succeeds.
	
	pdapilot.FileOpen(filename): Opens the named .prc or .pdb file
	
		returns a new pdapilot.file object if the file can be opened.
	
	pdapilot.FileCreate(filename, info): Creates the named .prc or .pdb file
	
		returns a new pdapilot.file object if the file can be created.
		info must be a dictionary containing elements such as these:
		
			flags, miscflags, type, creator, version, index, modnum,
			crdate, moddate, backupdate, name
		
		type and creator may each be an integer or a 4-character string.
	
	pdapilot.MemoUnpack(string): Unpacks a Memo record
	
		Treats string as a record from the MemoDB database and returns
		the contents in a dictionary.

	pdapilot.MemoPack(dict): Packs a Memo record
	
		Packs the dictionary into a string suitable for insertion
		in the MemoDB database.

	pdapilot.MemoUnpackAppBlock(string): Unpacks a Memo App block
	
		Treats string as the AppBlock from the MemoDB database and returns
		the contents in a dictionary.

	pdapilot.MemoPackAppBlock(dict): Packs a Memo App block
	
		Packs the dictionary into a string suitable for putting
		in the MemoDB database's AppBlock.

	pdapilot.TodoUnpack(string): Unpacks a Todo record

	pdapilot.TodoPack(dict): Packs a Todo record

	pdapilot.TodoUnpackAppBlock(string): Unpacks a Todo App block

	pdapilot.TodoPackAppBlock(dict): Packs a Todo App block
	
Methods of pdapilot.dlp:
	
	Close(status=0): Closes the Pilot connection
	
		If status is non-zero, convey that status to the Pilot.
		Note that Close is automatic on destruction of a pdapilot.dlp
		object.

	Open(name): Opens a database
	
		returns a new pdapilot.dlp.db object if successful, otherwise
		throws pdapilot.error.

	Create(name,...): Creates a database
	
		returns a new pdapilot.dlp.db object if successful, otherwise
		throws pdapilot.error.

	etc.
