Author: dmeyer
Date: Wed Jan 31 18:24:30 2007
New Revision: 9114
Added:
trunk/ui/src/menu/plugin.py
Modified:
trunk/ui/src/menu/__init__.py
trunk/ui/src/plugin.py
trunk/ui/src/plugins/file_ops.py
trunk/ui/src/plugins/shoppingcart.py
trunk/ui/src/video/plugins/bookmarker.py
trunk/ui/src/video/plugins/mover.py
Log:
move ItemPlugin into menu
Modified: trunk/ui/src/menu/__init__.py
==============================================================================
--- trunk/ui/src/menu/__init__.py (original)
+++ trunk/ui/src/menu/__init__.py Wed Jan 31 18:24:30 2007
@@ -36,6 +36,7 @@
from action import Action
from menu import Menu
from stack import MenuStack
+from plugin import ItemPlugin
class ActionItem(Item, Action):
"""
Added: trunk/ui/src/menu/plugin.py
==============================================================================
--- (empty file)
+++ trunk/ui/src/menu/plugin.py Wed Jan 31 18:24:30 2007
@@ -0,0 +1,62 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------------
+# plugin.py - Plugin interface to the menu
+# -----------------------------------------------------------------------------
+# $Id: plugin.py 9110 2007-01-31 09:24:06Z dmeyer $
+#
+# -----------------------------------------------------------------------------
+# Freevo - A Home Theater PC framework
+# Copyright (C) 2007 Dirk Meyer, et al.
+#
+# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
+# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
+#
+# Please see the file AUTHORS for a complete list of authors.
+#
+# 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 2 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 MER-
+# CHANTABILITY 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.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# -----------------------------------------------------------------------------
+
+from freevo.ui import plugin
+
+
+class ItemPlugin(plugin.Plugin):
+ """
+ Plugin class to add something to the item action list
+
+ The plugin can also have an eventhandler. All events passed to the item
+ will also be passed to this plugin. This works only for VideoItems right
+ now (each item type must support it directly). If the function returns
+ True, the event won't be passed to other eventhandlers and also not to
+ the item itself.
+ """
+ def __init__(self, name=''):
+ plugin.Plugin.__init__(self, name)
+ self._plugin_type = 'item'
+ self._plugin_special = True
+
+
+ def actions(self, item):
+ """
+ return a list of actions to that item. Each action is type Action
+ """
+ return []
+
+
+ def eventhandler(self, item, event):
+ """
+ Additional eventhandler for this item.
+ """
+ return False
Modified: trunk/ui/src/plugin.py
==============================================================================
--- trunk/ui/src/plugin.py (original)
+++ trunk/ui/src/plugin.py Wed Jan 31 18:24:30 2007
@@ -77,36 +77,6 @@
-class ItemPlugin(Plugin):
- """
- Plugin class to add something to the item action list
-
- The plugin can also have an eventhandler. All events passed to the item
- will also be passed to this plugin. This works only for VideoItems right
- now (each item type must support it directly). If the function returns
- True, the event won't be passed to other eventhandlers and also not to
- the item itself.
- """
- def __init__(self, name=''):
- Plugin.__init__(self, name)
- self._plugin_type = 'item'
- self._plugin_special = True
-
-
- def actions(self, item):
- """
- return a list of actions to that item. Each action is type Action
- """
- return []
-
-
- def eventhandler(self, item, event):
- """
- Additional eventhandler for this item.
- """
- return False
-
-
class MimetypePlugin(Plugin):
"""
Plugin class for mimetypes handled in a directory/playlist.
Modified: trunk/ui/src/plugins/file_ops.py
==============================================================================
--- trunk/ui/src/plugins/file_ops.py (original)
+++ trunk/ui/src/plugins/file_ops.py Wed Jan 31 18:24:30 2007
@@ -35,18 +35,15 @@
from kaa.notifier import Callback
# freevo imports
-from freevo.ui import config
-from freevo.ui import plugin
-from freevo.ui import util
-
-from freevo.ui.menu import Action
+from freevo.ui import config, util
+from freevo.ui.menu import Action, ItemPlugin
from freevo.ui.application import ConfirmWindow
# get logging object
log = logging.getLogger()
-class PluginInterface(plugin.ItemPlugin):
+class PluginInterface(ItemPlugin):
"""
Small plugin to delete files
"""
Modified: trunk/ui/src/plugins/shoppingcart.py
==============================================================================
--- trunk/ui/src/plugins/shoppingcart.py (original)
+++ trunk/ui/src/plugins/shoppingcart.py Wed Jan 31 18:24:30 2007
@@ -38,20 +38,17 @@
import kaa.notifier
# freevo imports
-from freevo.ui import plugin
-from freevo.ui.menu import Action
+from freevo.ui.menu import Action, ItemPlugin
-class PluginInterface(plugin.ItemPlugin):
+class PluginInterface(ItemPlugin):
"""
This plugin copies or moves files to directories. Go to a file hit
enter pick 'add to cart' and then go to a directory. Press enter
and pick what you want to do.
-
- plugin.activate('shoppingcart')
"""
def __init__(self):
- plugin.ItemPlugin.__init__(self)
+ ItemPlugin.__init__(self)
self.cart = []
Modified: trunk/ui/src/video/plugins/bookmarker.py
==============================================================================
--- trunk/ui/src/video/plugins/bookmarker.py (original)
+++ trunk/ui/src/video/plugins/bookmarker.py Wed Jan 31 18:24:30 2007
@@ -49,8 +49,7 @@
# freevo imports
import freevo.conf
-from freevo.ui.menu import Action, Menu
-from freevo.ui.plugin import ItemPlugin
+from freevo.ui.menu import Action, Menu, ItemPlugin
from freevo.ui.event import *
# the logging object
Modified: trunk/ui/src/video/plugins/mover.py
==============================================================================
--- trunk/ui/src/video/plugins/mover.py (original)
+++ trunk/ui/src/video/plugins/mover.py Wed Jan 31 18:24:30 2007
@@ -86,7 +86,7 @@
"""
Init the plugin.
"""
- plugin.ItemPlugin.__init__(self)
+ ItemPlugin.__init__(self)
self.from_dir = from_dir
self.to_dir = to_dir
self.recursive = recursive
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog