Author: dmeyer
Date: Sun Oct 29 10:28:50 2006
New Revision: 8504

Modified:
   trunk/ui/src/application/mplayer.py
   trunk/ui/src/input/plugins/dfbevents.py
   trunk/ui/src/input/plugins/event_device.py
   trunk/ui/src/input/plugins/lirc.py
   trunk/ui/src/menu/item.py
   trunk/ui/src/plugin.py
   trunk/ui/src/plugin_loader.py
   trunk/ui/src/plugins/idlebar/__init__.py
   trunk/ui/src/plugins/mixer.py
   trunk/ui/src/plugins/ossmixer.py

Log:
hide some plugin internals

Modified: trunk/ui/src/application/mplayer.py
==============================================================================
--- trunk/ui/src/application/mplayer.py (original)
+++ trunk/ui/src/application/mplayer.py Sun Oct 29 10:28:50 2006
@@ -210,8 +210,7 @@
         """
         Init the plugin.
         """
-        plugin.Plugin.__init__(self)
-        self.plugin_name = 'mplayer_' + type
+        plugin.Plugin.__init__(self, 'mplayer_' + type)
 
 
     def play(self, command, application):

Modified: trunk/ui/src/input/plugins/dfbevents.py
==============================================================================
--- trunk/ui/src/input/plugins/dfbevents.py     (original)
+++ trunk/ui/src/input/plugins/dfbevents.py     Sun Oct 29 10:28:50 2006
@@ -54,8 +54,6 @@
     def __init__(self):
         InputPlugin.__init__(self)
 
-        self.plugin_name = 'DirectFB Input'
-
         if config.GUI_DISPLAY.lower() == 'dfb':
             self.dfb = gui.displays.get().dfb
         else:

Modified: trunk/ui/src/input/plugins/event_device.py
==============================================================================
--- trunk/ui/src/input/plugins/event_device.py  (original)
+++ trunk/ui/src/input/plugins/event_device.py  Sun Oct 29 10:28:50 2006
@@ -104,7 +104,6 @@
     def __init__(self):
         InputPlugin.__init__(self)
 
-        self.plugin_name = 'EVDEV'
         self.device_name = config.EVDEV_DEVICE
         self._ignore_until = 0
         self.repeat_ignore = config.EVDEV_REPEAT_IGNORE

Modified: trunk/ui/src/input/plugins/lirc.py
==============================================================================
--- trunk/ui/src/input/plugins/lirc.py  (original)
+++ trunk/ui/src/input/plugins/lirc.py  Sun Oct 29 10:28:50 2006
@@ -73,7 +73,7 @@
     """
     def __init__(self):
         InputPlugin.__init__(self)
-        self.plugin_name = 'LIRC'
+
         try:
             if os.path.isfile(config.LIRCRC):
                 fd = pylirc.init('freevo', config.LIRCRC)

Modified: trunk/ui/src/menu/item.py
==============================================================================
--- trunk/ui/src/menu/item.py   (original)
+++ trunk/ui/src/menu/item.py   Sun Oct 29 10:28:50 2006
@@ -154,7 +154,7 @@
         items = self.actions()
         # get actions defined by plugins
         plugins = plugin.get('item') + plugin.get('item_%s' % self.type)
-        plugins.sort(lambda l, o: cmp(l.plugin_level, o.plugin_level))
+        plugins.sort(lambda l, o: cmp(l._plugin_level, o._plugin_level))
         for p in plugins:
             for a in p.actions(self):
                 # set item for the action

Modified: trunk/ui/src/plugin.py
==============================================================================
--- trunk/ui/src/plugin.py      (original)
+++ trunk/ui/src/plugin.py      Sun Oct 29 10:28:50 2006
@@ -51,14 +51,14 @@
     """
     Basic plugin class.
     """
-    def __init__(self):
+    def __init__(self, name=''):
         """
         Execute on activation of the plugin.
         """
         for var, val, desc in self.config():
             if not hasattr(config, var):
                 setattr(config, var, val)
-        plugin_loader.Plugin.__init__(self)
+        plugin_loader.Plugin.__init__(self, name)
 
 
     def config(self):
@@ -92,10 +92,10 @@
     """
     Plugin class for plugins to add something to the main menu
     """
-    def __init__(self):
-        Plugin.__init__(self)
-        self.plugin_type = 'mainmenu'
-        self.plugin_special = True
+    def __init__(self, name=''):
+        Plugin.__init__(self, name)
+        self._plugin_type = 'mainmenu'
+        self._plugin_special = True
 
 
     def items(self, parent):
@@ -116,10 +116,10 @@
     True, the event won't be passed to other eventhandlers and also not to
     the item itself.
     """
-    def __init__(self):
-        Plugin.__init__(self)
-        self.plugin_type = 'item'
-        self.plugin_special = True
+    def __init__(self, name=''):
+        Plugin.__init__(self, name)
+        self._plugin_type = 'item'
+        self._plugin_special = True
 
 
     def actions(self, item):
@@ -142,10 +142,10 @@
     self.display_type is a list of display types where this mimetype
     should be displayed, [] for always.
     """
-    def __init__(self):
-        Plugin.__init__(self)
+    def __init__(self, name=''):
+        Plugin.__init__(self, name)
         self.display_type = []
-        self.plugin_type = 'mimetype'
+        self._plugin_type = 'mimetype'
 
 
     def suffix(self):

Modified: trunk/ui/src/plugin_loader.py
==============================================================================
--- trunk/ui/src/plugin_loader.py       (original)
+++ trunk/ui/src/plugin_loader.py       Sun Oct 29 10:28:50 2006
@@ -50,11 +50,11 @@
     """
     Basic plugin class. All plugins should inherit from this class
     """
-    def __init__(self):
-        self.plugin_type = None
-        self.plugin_level  = 10
-        self.plugin_name = ''
-        self.plugin_special = False
+    def __init__(self, name=''):
+        self._plugin_type = None
+        self._plugin_level  = 10
+        self._plugin_name = name
+        self._plugin_special = False
 
 
     def plugin_activate(self):
@@ -111,7 +111,7 @@
         if self.__initialized:
             self.__load_plugin(name, type, level, args)
             # sort plugins again
-            cmp_func = lambda l, o: cmp(l.plugin_level, o.plugin_level)
+            cmp_func = lambda l, o: cmp(l._plugin_level, o._plugin_level)
             for key in self.types:
                 self.types[key].sort(cmp_func)
         else:
@@ -183,7 +183,7 @@
             self.__load_plugin(name, type, level, args)
 
         # sort plugins
-        cmp_func = lambda l, o: cmp(l.plugin_level, o.plugin_level)
+        cmp_func = lambda l, o: cmp(l._plugin_level, o._plugin_level)
         for key in self.types:
             self.types[key].sort(cmp_func)
 
@@ -300,7 +300,7 @@
                 else:
                     p = eval(object)(args)
 
-                if not hasattr(p, 'plugin_type'):
+                if not hasattr(p, '_plugin_type'):
                     if hasattr(p, 'reason'):
                         reason = p.reason
                     else:
@@ -314,23 +314,23 @@
                 p = name
 
             p.plugin_activate()
-            p.plugin_level = level
+            p._plugin_level = level
 
             if type:
                 special = type
 
-            if p.plugin_type:
-                if p.plugin_special and special:
-                    key = p.plugin_type + '_' + special
+            if p._plugin_type:
+                if p._plugin_special and special:
+                    key = p._plugin_type + '_' + special
                 else:
-                    key = p.plugin_type
+                    key = p._plugin_type
 
                 if not self.types.has_key(key):
                     self.types[key] = []
                 self.types[key].append(p)
 
-            if p.plugin_name:
-                self.names[p.plugin_name] = p
+            if p._plugin_name:
+                self.names[p._plugin_name] = p
 
             self.loaded_plugins.append(p)
             

Modified: trunk/ui/src/plugins/idlebar/__init__.py
==============================================================================
--- trunk/ui/src/plugins/idlebar/__init__.py    (original)
+++ trunk/ui/src/plugins/idlebar/__init__.py    Sun Oct 29 10:28:50 2006
@@ -237,7 +237,7 @@
 class IdleBarPlugin(plugin.Plugin):
     def __init__(self):
         plugin.Plugin.__init__(self)
-        self.plugin_type = 'idlebar'
+        self._plugin_type = 'idlebar'
         self.objects   = []
         self.NO_CHANGE = -1
         self.align     = 'left'

Modified: trunk/ui/src/plugins/mixer.py
==============================================================================
--- trunk/ui/src/plugins/mixer.py       (original)
+++ trunk/ui/src/plugins/mixer.py       Sun Oct 29 10:28:50 2006
@@ -92,7 +92,6 @@
     SOUND_MASK_LINE = 64
     
     def __init__(self):
-        self.plugin_name = 'MIXER'
         self.mixfd = None
         self.muted = 0
         
@@ -105,7 +104,7 @@
                 log.error('Couldn\'t open mixer %s' % config.DEV_MIXER)
                 return
 
-        plugin.Plugin.__init__(self)
+        plugin.Plugin.__init__(self, 'MIXER')
 
         events = [MIXER_VOLUP, MIXER_VOLDOWN, MIXER_MUTE]
         EventHandler(self.eventhandler).register(events)

Modified: trunk/ui/src/plugins/ossmixer.py
==============================================================================
--- trunk/ui/src/plugins/ossmixer.py    (original)
+++ trunk/ui/src/plugins/ossmixer.py    Sun Oct 29 10:28:50 2006
@@ -95,7 +95,6 @@
     SOUND_MASK_LINE = 64
     
     def __init__(self):
-        self.plugin_name = 'MIXER'
         self.mixfd = None
         self.muted = 0
         
@@ -108,7 +107,7 @@
                 log.error('Couldn\'t open mixer %s' % config.DEV_MIXER)
                 return
 
-        plugin.Plugin.__init__(self)
+        plugin.Plugin.__init__(self, 'MIXER')
 
         events = [MIXER_VOLUP, MIXER_VOLDOWN, MIXER_MUTE]
         EventHandler(self.eventhandler).register(events)

-------------------------------------------------------------------------
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

Reply via email to