Re: [jokosher-devel] IMPORTANT: Stuff to do for 0.2



Jono Bacon a écrit :
 * Extension API - finishing off the API making it as complete as
possible for the 0.2 release. The approach being used is to make
useful extensions and add features to the API where needed. Could
Laszlo or Aq give us an update on this effort. Cheers.

Currently the extension API works, even though we are still lacking in functions. The extensions in SVN will not load by default unless you set the environment variable JOKOSHER_EXTENSION_DIRS to $mysvnroot/extensions/trunk and you have $mysvnroot/JonoEdit/trunk in your python path. Once the API is a little further to completion, this variable will be added to the startup script so that they load on default.

All of the descriptions from here: http://jokosher.python-hosting.com/wiki/ExtensionIdeas
need to be coded and then written up in here:
http://jokosher.python-hosting.com/wiki/TemporaryExtensionAPIDocumentation

Just remember when writing functions that the extensions should not have direct access to essential Jokosher objects. If you need to return a list of the available instrument (this one I already wrote), return a copy of Jokosher's list. If they need to get information from the pipeline, implement main_pipeline_get_property() instead of passing them the entire pipeline object (which could be dangerous).

And finally, please write more extensions! Here is the Hello World Jokosher extension:
#!/usr/bin/python
from Jokosher.Extensions import API
import gtk

#callback for menu entry
def HelloWorld():
	#launch gtk dialog
	dlg = gtk.MessageDialog(message_format="Hello World")
	dlg.run()
	dlg.destroy()

#called by Jokosher when it wants up to startup
def startup(API):
	API.add_menu_item("Hello World GTK", HelloWorld)

This extension will add a menu entry to the Extensions menu that when clicked will popup a gtk message box saying "Hello World".

Laszlo




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]