Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Gordon Allott <gordallott@gm...> - 2008-07-29 11:55:52
|
Hi, I finally got around to getting going on plugin writing so i just want to check with you guys that I'm heading in the right direction. Basically i just created a file named plugin.py that is defined as follows: #!/usr/bin/env python # plugin.py # # Copyright 2008 Gordon Allott <gordallott@...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # from zope.interface import Interface, Attribute import zope.interface as interface from pitivi import plugincore class Plugin: interface.implements(plugincore.IPlugin) name = 'test plugin' catagory = 'test' description = 'a test plugin, just gets the interface going' version = 1.0 authors = 'Foobar' settings = ['foo', 'bar'] enabled = True def __call__(self, manager): """ called when the plugin is loaded? """ self.manager = manager print "Hello World! this is a __call__ function" def __init__(self, manager=None): self.__call__(manager) I'm not so sure about the __init__ and call separation, it looks like IPlugin wants to call __call__ when it loads the plugin (pluginmanager.py: 361) passing it the manager, just like it specifies in the IPlugin instance class but instead __init__ gets called. -- Gordon Allott <gordallott@...> |