[Sugar-devel] more TA plugin changes...

Walter Bender walter.bender at gmail.com
Thu Apr 7 11:15:33 EDT 2011


In the run up to v107, I am making some more changes (hopefully for
the better) to the plugin mechanism for Turtle Art.

I just pushed a series of patches that require another reorganization
of the code, as follows:

Required:
(1) each plugin lives in its own subdirectory in ./plugins
(2) in that subdirectory is a .py of the same name as the directory
(3) in that .py file is defined a class with the same name as the file
(but with the first letter capitalized, e.g.,
./plugins/camera_sensor/camera_sensor.py defined a Camera_sensor
class, a subclass of plugins.plugin Plugin

Optional:
(4) If you define your own palette, you may put icons in an icon
subdirectory; no need to put them in ./icons anymore. e.g.,
./plugins/camera_sensor/icons/sensoron.svg and
./plugins/camera_sensor/icons/sensoroff.svg

Obscure:
(5) I am also working on a mechanism where by you can define custom
logo code associated with your custom blocks for use in the
export-to-logo method.

Still to be debugged:
(6) I think I introduced a regression in the sensor code in my latest
incarnation. Investigating.
(7) In a manner similar to the icons, I need to sort out a mechanism
for adding skins to your custom blocks.

Under discussion:
What should we do when a plugin is unavailable, e.g., the Arduino is
not present? I think we want to define the blocks regardless, but
associate a NOP. This will mean that children can explore their
program logic even if they don't have constant access to shared
hardware.
Thoughts?


My apologies for all of these changes, but I want to get it as close
to correct as I can before releasing this more broadly. Your feedback
to date has been very helpful.

regards.

-walter

-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list