Hi,
Your little plugin should work, you just need a few changes:
import os
import plugin
import menu
class PluginInterface(plugin.MainMenuPlugin):
"""
Plugin for launching mbux
Example:
plugin.activate('mbux')
"""
def __init__(self):
plugin.MainMenuPlugin.__init__(self)
self.parent = None
def items(self, parent):
self.parent = parent
# this is the action
return [menu.MenuItem(_('MBUX'), action=self.launch)]
def launch(self,arg=None, menuw=None):
os.system('/opt/mbux/bin/mbux')
menuw.delete_menu(arg, menuw)
or use the commands plugin as Gorka suggested.
Regards
Tanja
Dan schrieb:
> Hi all.
>
> I've turned off the bits I don't want, and now I want to add a new bit
> to freevo.
>
> All it needs to do is launch an external executable. I've created
> /usr/lib/python2.4/site-packages/freevo/plugins/mbux.py like this:
>
> import os
> import plugin
> class PluginInterface(plugin.MainMenuPlugin):
> """
> Plugin for launching mbux
>
> Example:
> plugin.activate('mbux')
> """
> def __init__(self):
> plugin.MainMenuPlugin.__init__(self)
>
> def actions(self,item):
> self.item = item
> return []
>
> def launch(self,arg=None, menuw=None):
> item=self.item
> os.system('/opt/mbux/bin/mbux')
> menuw.delete_menu(arg, menuw)
>
>
> and altered the current skin, panorama.fxd to include this:
> <main imagedir="panorama">
> <item label="mbux" name="Launch mbux"
> image="panorama/myth_tv.png"/>
>
>
> Of course, I'm just copying the plugins of others, so I'm not sure how
> it all works.
> freevo plugins -l shows it exists, and no errors are seen on startup
> about it, so I'm thinking that I've edited the wrong skin file, or in
> the wrong way. Can anyone shed any light on this?
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Freevo-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freevo-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users