LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   writing a freevo plugin (https://www.linuxquestions.org/questions/programming-9/writing-a-freevo-plugin-387125/)

shanenin 11-27-2005 08:43 PM

writing a freevo plugin
 
This is more freevo specific then python specific. If any of you have written any plugins for freevo maybe you can see what I am doung wrong.
below is my code
Code:

#!/usr/bin/env python
#
# this is my first attempt to make a freevo plugin

import os
import plugin
import config

class PluginInterface(plugin.ItemPlugin):
    """
    this is a test plugin to see if I can add a command to the menu
    """
    def __init__(self):
        plugin.ItemPlugin.__init__(self)

    def actions(self, item):
        return [ (self.test_command, "shane's command") ]

    def test_command(self):
        item = self.item
        os.system('touch %s'%item.filename)

I am getting this error in my freevo log

Code:

    action( arg=arg, menuw=self )
  File "/usr/lib/python2.4/site-packages/freevo/menu.py", line 87, in select
    self.function(arg=self.arg, menuw=menuw)
TypeError: test_command() got an unexpected keyword argument 'arg'

any suggestions would be appreciated

shanenin 11-27-2005 10:31 PM

I figured out what I was doing wrong. I did not have self.item set to any thing

I changed that code from this
Code:

def actions(self, item):
        return [ (self.test_command, "shane's command") ]

to

Code:

def actions(self, item):
        self.item = item
        return [ (self.test_command, "shane's command") ]

freevo is great, it makes adding feature very easy. I now should be able to add my python script that makes mplayer conf files to crop avi files

phishman3579 12-07-2005 06:31 PM

If you have any questions, I have alot of experience with Freevo plugins. I am starting a help page specifically for Freevo. http://freevohelp.com


All times are GMT -5. The time now is 06:23 PM.