home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / os2 / plnk065.arj / PLNK065.ZIP / pilot-link.0.6.5 / Python / README < prev    next >
Encoding:
Text File  |  1997-05-23  |  2.8 KB  |  96 lines

  1.  
  2. This is an experimental piece of code to interface Python to the pilot-link
  3. library. To use it, you will have to figure out how to link and install the
  4. .c file so that your Python installation can use it. The included Makefile
  5. will probably only work for ELF systems.
  6.  
  7. (Note that I have only tested this with Python 1.4, and have no particular
  8. expectation of it working with earlier or later versions.)
  9.  
  10. Usage notes:
  11.  
  12.     Start with 'importing pdapilot'.
  13.     
  14.     Look at test.py for examples of simple usage.
  15.     
  16. Documentation (such as it is):    
  17.     
  18.     pdapilot.OpenPort(device): Open a device, ready for Accept
  19.         
  20.         returns a file descriptor which may be used to access the given device
  21.         (serial port) with the Accept routine.
  22.         
  23.         This routine is built out of Socket, Bind, & Listen.
  24.  
  25.     pdapilot.Socket(domain,type,protocol): returns a new pilot socket.
  26.  
  27.     pdapilot.Bind(socket, address): binds a socket to the given address.
  28.  
  29.     pdapilot.Listen(socket, backup):
  30.     
  31.     pdapilot.Accept(socket): Waits for incoming Pilot connection
  32.     
  33.         returns a new pdapilot.dlp object if a connection succeeds.
  34.     
  35.     pdapilot.FileOpen(filename): Opens the named .prc or .pdb file
  36.     
  37.         returns a new pdapilot.file object if the file can be opened.
  38.     
  39.     pdapilot.FileCreate(filename, info): Creates the named .prc or .pdb file
  40.     
  41.         returns a new pdapilot.file object if the file can be created.
  42.         info must be a dictionary containing elements such as these:
  43.         
  44.             flags, miscflags, type, creator, version, index, modnum,
  45.             crdate, moddate, backupdate, name
  46.         
  47.         type and creator may each be an integer or a 4-character string.
  48.     
  49.     pdapilot.MemoUnpack(string): Unpacks a Memo record
  50.     
  51.         Treats string as a record from the MemoDB database and returns
  52.         the contents in a dictionary.
  53.  
  54.     pdapilot.MemoPack(dict): Packs a Memo record
  55.     
  56.         Packs the dictionary into a string suitable for insertion
  57.         in the MemoDB database.
  58.  
  59.     pdapilot.MemoUnpackAppBlock(string): Unpacks a Memo App block
  60.     
  61.         Treats string as the AppBlock from the MemoDB database and returns
  62.         the contents in a dictionary.
  63.  
  64.     pdapilot.MemoPackAppBlock(dict): Packs a Memo App block
  65.     
  66.         Packs the dictionary into a string suitable for putting
  67.         in the MemoDB database's AppBlock.
  68.  
  69.     pdapilot.TodoUnpack(string): Unpacks a Todo record
  70.  
  71.     pdapilot.TodoPack(dict): Packs a Todo record
  72.  
  73.     pdapilot.TodoUnpackAppBlock(string): Unpacks a Todo App block
  74.  
  75.     pdapilot.TodoPackAppBlock(dict): Packs a Todo App block
  76.     
  77. Methods of pdapilot.dlp:
  78.     
  79.     Close(status=0): Closes the Pilot connection
  80.     
  81.         If status is non-zero, convey that status to the Pilot.
  82.         Note that Close is automatic on destruction of a pdapilot.dlp
  83.         object.
  84.  
  85.     Open(name): Opens a database
  86.     
  87.         returns a new pdapilot.dlp.db object if successful, otherwise
  88.         throws pdapilot.error.
  89.  
  90.     Create(name,...): Creates a database
  91.     
  92.         returns a new pdapilot.dlp.db object if successful, otherwise
  93.         throws pdapilot.error.
  94.  
  95.     etc.
  96.