diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-02-23 00:09:17 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-02-23 00:09:17 +0000 |
| commit | 4b0a216bcf413989b5a7e6c1ad0275247fabca9c (patch) | |
| tree | e8bde67156acd5a46a612481794c20474261aadf /lib/python | |
| parent | 71798ac3f2d13f01501476fc7fcc00c49303e88a (diff) | |
| download | enigma2-4b0a216bcf413989b5a7e6c1ad0275247fabca9c.tar.gz enigma2-4b0a216bcf413989b5a7e6c1ad0275247fabca9c.zip | |
recursively search for plugins
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/PluginComponent.py | 16 | ||||
| -rw-r--r-- | lib/python/Plugins/DemoPlugins/Makefile.am | 6 | ||||
| -rw-r--r-- | lib/python/Plugins/DemoPlugins/__init__.py | 0 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/Makefile.am | 6 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/__init__.py | 0 | ||||
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/Makefile.am | 6 | ||||
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/__init__.py | 0 |
7 files changed, 27 insertions, 7 deletions
diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py index eeb2c974..ae06d776 100644 --- a/lib/python/Components/PluginComponent.py +++ b/lib/python/Components/PluginComponent.py @@ -4,6 +4,7 @@ from Tools.Directories import * from Plugins.Plugin import PluginDescriptor def my_import(name): + print name mod = __import__(name) components = name.split('.') for comp in components[1:]: @@ -33,22 +34,21 @@ class PluginComponent: if x == PluginDescriptor.WHERE_AUTOSTART: plugin(reason=1) - def readPluginList(self): + def readPluginList(self, directory, modules = [], depth = 1): """enumerates plugins""" - - directories = os.listdir(resolveFilename(SCOPE_PLUGINS)) + + directories = os.listdir(directory) for x in directories: - path = resolveFilename(SCOPE_PLUGINS, x) + "/" - if os.path.exists(path): + path = directory + x + "/" + if os.path.isdir(path): if fileExists(path + "plugin.py"): - plugin = my_import('.'.join(("Plugins", x, "plugin"))) + plugin = my_import('.'.join(["Plugins"] + modules + [x, "plugin"])) if not plugin.__dict__.has_key("Plugins"): print "Plugin %s doesn't have 'Plugin'-call." % (x) continue - print "plugin", plugin plugins = plugin.Plugins() # allow single entry not to be a list @@ -58,6 +58,8 @@ class PluginComponent: for p in plugins: p.updateIcon(path) self.addPlugin(p); + else: + self.readPluginList(path, modules + [x], depth - 1) def getPlugins(self, where): """Get list of plugins in a specific category""" diff --git a/lib/python/Plugins/DemoPlugins/Makefile.am b/lib/python/Plugins/DemoPlugins/Makefile.am index 86e98ec2..2d050dc1 100644 --- a/lib/python/Plugins/DemoPlugins/Makefile.am +++ b/lib/python/Plugins/DemoPlugins/Makefile.am @@ -1 +1,7 @@ SUBDIRS = TestPlugin + +installdir = $(LIBDIR)/enigma2/python/Plugins/DemoPlugins + +install_PYTHON = \ + __init__.py + diff --git a/lib/python/Plugins/DemoPlugins/__init__.py b/lib/python/Plugins/DemoPlugins/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/python/Plugins/DemoPlugins/__init__.py diff --git a/lib/python/Plugins/Extensions/Makefile.am b/lib/python/Plugins/Extensions/Makefile.am index a8998c13..656ca879 100644 --- a/lib/python/Plugins/Extensions/Makefile.am +++ b/lib/python/Plugins/Extensions/Makefile.am @@ -1 +1,7 @@ SUBDIRS = TuxboxPlugins WebInterface FileManager + +installdir = $(LIBDIR)/enigma2/python/Plugins/Extensions + +install_PYTHON = \ + __init__.py + diff --git a/lib/python/Plugins/Extensions/__init__.py b/lib/python/Plugins/Extensions/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/python/Plugins/Extensions/__init__.py diff --git a/lib/python/Plugins/SystemPlugins/Makefile.am b/lib/python/Plugins/SystemPlugins/Makefile.am index 2b71624c..aa71df93 100644 --- a/lib/python/Plugins/SystemPlugins/Makefile.am +++ b/lib/python/Plugins/SystemPlugins/Makefile.am @@ -1 +1,7 @@ SUBDIRS = SoftwareUpdate FrontprocessorUpgrade + +installdir = $(LIBDIR)/enigma2/python/Plugins/SystemPlugins + +install_PYTHON = \ + __init__.py + diff --git a/lib/python/Plugins/SystemPlugins/__init__.py b/lib/python/Plugins/SystemPlugins/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/__init__.py |
