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 <[EMAIL PROTECTED]>
#
#       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 <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pitivi-pitivi mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pitivi-pitivi

Reply via email to