Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8206

Modified Files:
        command.py 
Log Message:
move main menu item into this file.

Index: command.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/command.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** command.py  14 Feb 2004 15:44:21 -0000      1.6
--- command.py  14 Feb 2004 19:01:49 -0000      1.7
***************
*** 15,18 ****
--- 15,21 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.7  2004/02/14 19:01:49  mikeruelle
+ # move main menu item into this file.
+ #
  # Revision 1.6  2004/02/14 15:44:21  dischi
  # add more doc and add <stdout> to supress showing the stdout
***************
*** 283,287 ****
      
  
! class CommandMainMenuItem(Item):
      """
      this is the item for the main menu and creates the list
--- 286,290 ----
      
  
! class CommandMenuItem(Item):
      """
      this is the item for the main menu and creates the list
***************
*** 360,364 ****
          
      def items(self, parent):
!         return [ CommandMainMenuItem(parent) ]
  
      def config(self):
--- 363,367 ----
          
      def items(self, parent):
!         return [ CommandMenuItem(parent) ]
  
      def config(self):
***************
*** 403,404 ****
--- 406,435 ----
          return [ ('COMMAND_SPAWN_WM', '', 'command to start window manager.'),
                   ('COMMAND_KILL_WM', '', 'command to stop window manager.') ]
+ 
+ 
+ class CommandMainMenuItem(plugin.MainMenuPlugin):
+     """
+     A small plugin to put a command in the main menu.
+     Uses the command.py fxd file format to say which command to run.
+     All output is logged in the freevo logdir.
+     to activate it, put the following in your local_conf.py:
+ 
+     plugin.activate('command.CommandMainMenuItem', 
args=(/usr/local/freevo_data/Commands/Mozilla.fxd', ), level=45) 
+ 
+     The level argument is used to influence the placement in the Main Menu.
+     consult freevo_config.py for the level of the other Menu Items if you
+     wish to place it in a particular location.
+     """
+     def __init__(self, commandxmlfile):
+         plugin.MainMenuPlugin.__init__(self)
+         self.cmd_xml = commandxmlfile
+     
+     def items(self, parent):
+         command_items = []
+         parser = util.fxdparser.FXD(self.cmd_xml)
+         parser.setattr(None, 'items', command_items)
+         parser.set_handler('command', fxdparser)
+         parser.parse()
+         cmd_item = command_items[0]
+         return [ cmd_item ]
+ 



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to