Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activities/Turtle Art/Plugins
(view source)
Revision as of 09:04, 23 January 2012
35 bytes added
,
09:04, 23 January 2012
→How to write a plugin
Line 132:
Line 132:
For example:
For example:
−
* the camera plugin, <code>
camera_plugin
.py</code> is in <code>./plugns/
camera_plugin
</code>
+
* the camera plugin, <code>
camera_sensor
.py</code> is in <code>./plugns/
camera_sensor
</code>
−
* the class, <code>
Camera_plugin
</code> is defined in <code>
camera_plugin
.py</code>, e.g.,
+
* the class, <code>
Camera_sensor
</code> is defined in <code>
camera_sensor
.py</code>, e.g.,
−
class
Camera_plugin
(Plugin):
+
from plugins.plugin import Plugin
+
class
Camera_sensor
(Plugin):
You will also need a __init__.py file and optionally, an icon subdirectory for your palette icon.
You will also need a __init__.py file and optionally, an icon subdirectory for your palette icon.
Walter
Bureaucrats
,
Administrators
10,579
edits