Merge lp:~joshuascotton/entertainer/pluginsV2 into lp:entertainer
Proposed by
Joshua Scotton
Status: | Rejected |
---|---|
Rejected by: | Paul Hummer |
Proposed branch: | lp:~joshuascotton/entertainer/pluginsV2 |
Merge into: | lp:entertainer |
To merge this branch: | bzr merge lp:~joshuascotton/entertainer/pluginsV2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer | Needs Fixing | ||
Entertainer Release Team | preliminary | Pending | |
Review via email: mp+1474@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 293. By Joshua Scotton
-
initial work on plugin framework and demo HelloWorld plugin
=== modified file 'entertainerlib /__init_ _.py' __init_ _.py 2008-06-22 05:08:20 +0000 __init_ _.py 2008-10-31 15:30:32 +0000
--- entertainerlib/
+++ entertainerlib/
@@ -1,1 +1,3 @@
'''Entertainer libraries'''
+
+__version__ = 0.2
=== modified file 'entertainerlib /frontend/ frontend_ client. py' frontend/ frontend_ client. py 2008-08-14 23:53:09 +0000 frontend/ frontend_ client. py 2008-10-31 15:16:15 +0000
--- entertainerlib/
+++ entertainerlib/
@@ -7,6 +7,7 @@
import sys
+from entertainerlib. utils.plugins import PluginManager utils.configura tion import Configuration utils.logger import Logger frontend. backend_ connection import BackendConnection
from entertainerlib.
from entertainerlib.
from entertainerlib.
@@ -48,6 +49,15 @@
+
+ self.pm = PluginManager()
+
+ print "Starting plugins..."
+
+ for plugin in self.pm.
+ print 'Starting %s...' % (plugin)
+ plugin.load()
+
=== modified file 'entertainerlib /frontend/ gui/user_ interface. py' frontend/ gui/user_ interface. py 2008-10-07 23:23:12 +0000 frontend/ gui/user_ interface. py 2008-10-31 15:06:37 +0000 pm.get_ plugins_ by_capability( on_event( event)
--- entertainerlib/
+++ entertainerlib/
@@ -495,6 +495,10 @@
@param event: UserEvent object, defines what action has been taken
"""
type = event.get_type()
+
+ for plugin in self.frontend.
+ 'EventPlugin'):
+ plugin.
if(type == UserEvent. PLAYER_ PLAY_PAUSE) : is_interested_ in_play_ action( ):
if self.current.
=== added directory 'entertainerlib /plugins' /plugins/ __init_ _.py' /utils/ plugins. py' utils/plugins. py 1970-01-01 00:00:00 +0000 utils/plugins. py 2008-10-31 15:49:50 +0000 join(os. path.dirname( __file_ _), "../../plugins"), share/entertain er/plugins" , expanduser( "~/.config/ entertainer/ plugins" ) ] __path_ _ = self.PLUGIN_DIRS plugin_ module( path):
=== added file 'entertainerlib
=== added file 'entertainerlib
--- entertainerlib/
+++ entertainerlib/
@@ -0,0 +1,87 @@
+"""Plugin Manager Class and Base Plugin Class"""
+
+__licence__ = "GPLv2"
+__copyright__ = "2008, Joshua Scotton"
+__author__ = "Joshua Scotton <email address hidden>"
+
+import os
+
+import entertainerlib
+from entertainerlib import plugins as mod_plugins
+
+
+class PluginManager:
+ """
+ @author Joshua Scotton
+ """
+
+ PLUGIN_DIRS = [ os.path.
+ #"/usr/
+ os.path.
+
+ plugins = {}
+
+ def __init__(self):
+ self.load_plugins()
+
+ def load_plugins(self):
+ #setup plugin paths
+ mod_plugins.
+
+ #load plugin names
+ plugin_names = []
+ for dir in self.PLUGIN_DIRS:
+ for name in os.listdir(dir):
+ path = os.path.join(dir, name)
+ if os.path.isdir(path) and self.is_
+ plugin_...