Papaya now has support for plugins written in Python.  You will need to
compile and install the PythonPlugin module, using either:

  ./configure --enable-python

or

  ./configure --enable-all

Followed by the usual 'make' and 'make install'.

Papaya provides a module called 'papaya' that should be imported into all
python plugins.

papaya.output_add(string)
-------------------------

  Registers a function to be called when Papaya receives some output from
  a MUD.

  The return value from this function should be the provided string, or if
  this function modifies the text, the modified text.

  Note that a prompt may well be sent with this text.  A prompt that has
  been detected as a prompt line will have its last character as \001.

papaya.input_add(string)
------------------------

  Registers a function to be called when the user sends a command to a MUD.

  The return value from this function should be the provided string, or if
  this function modifies the text, the modified text.

papaya.prompt_add(string)
-------------------------

  Registers a function to be called when Papaya detects a prompt sent by a
  MUD.

  The return value from this function should be the provided string, or if
  this function modifies the text, the modified text.

papaya.event_add(string)
------------------------

  Registers a function to be called when Papaya receives an EvConnect or
  EvDisconnect event.  The callback function will be provided with a single
  argument containing "connect" or "disconnect" indicating the event type.
  The connection receiving the event is in the variable "papaya_connection".

papaya.output_remove(string)
papaya.input_remove(string)
papaya.prompt_remove(string)
papaya.event_remove(string)
----------------------------

  These functions remove the callback added with the relevant *_add function.

papaya.send(string)
-------------------

  Sends text to the currently active MUD.  The currently active MUD is the
  one that called the input/output/prompt callback function.  This function
  is nearly always the one that you want to use to send text.

papaya.sendto(mud-string, text-string)
--------------------------------------

  Sends text to the MUD with the specified name.  This name can be retrieved
  during an input/output/prompt callback by extracting the contents of the
  variable 'papaya_connection'.

papaya.message(title-string, text-string)
-----------------------------------------

  Pops up a standard Papaya message dialog.  The 'title' is what appears in
  the title bar, and 'text' is what appears in the dialog.  Only one button
  is present in the dialog, 'OK'.

papaya.turf_protocol_add(command-string, callback-string, data-string)
----------------------------------------------------------------------

  Allows access to the TurfProtocol->addCommand() stuff from Python.  The
  'command' is a string and the command to be sent to the MUD.  The callback
  is a string - the function name to be called when the command returns.
  'data' is a string which is passed to the callback function - this can be
  used to store data such as at what time the command was issued, etc.

  The callback function should expect two arguments- the first is the text
  received, the second is the data parameter provided to turf_protocol_add.
  N.B. the callback function will be called multiple times for the same
  command.  The last call to the function will have the first argument set
  to None.

                              Using a Plugin
                              ==============

To use a plugin, copy it to your $HOME/.papaya directory.  It can be loaded
by typing 'python plugin_name' in the input box when connected to any MUD.
Alternatively, you can load it from the init.py script in $HOME/.papaya.

                              Example Plugins
                              ===============

Some example plugins can be found in the 'contrib' directory.
