diff options
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/PluginComponent.py | 36 | ||||
| -rw-r--r-- | lib/python/Plugins/Makefile.am | 7 | ||||
| -rw-r--r-- | lib/python/Plugins/update/Makefile.am (renamed from lib/python/Plugins/update.png) | 0 | ||||
| -rw-r--r-- | lib/python/Plugins/update/update.png (renamed from lib/python/Plugins/update.py) | 0 | ||||
| -rw-r--r-- | lib/python/Tools/Directories.py | 2 |
5 files changed, 26 insertions, 19 deletions
diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py index 5315d3d9..0b407021 100644 --- a/lib/python/Components/PluginComponent.py +++ b/lib/python/Components/PluginComponent.py @@ -2,7 +2,6 @@ import os from Tools.Directories import * from Screens.Menu import menuupdater -#import Plugins class PluginComponent: def __init__(self): @@ -15,22 +14,27 @@ class PluginComponent: def getPluginList(self): list = [] - dir = os.listdir("/usr/lib/enigma2/python/Plugins/") + dir = os.listdir(resolveFilename(SCOPE_PLUGINS)) self.menuDelete() self.menuEntries = [] - for x in dir: - if x[-3:] == ".py" and x[:-3] != "__init__": - print "trying to import " + self.prefix + x[:-3] - exec "import " + self.prefix + x[:-3] - picturepath = eval(self.prefix + x[:-3]).getPicturePath() - pluginname = eval(self.prefix + x[:-3]).getPluginName() - try: - for menuEntry in eval(self.prefix + x[:-3]).getMenuRegistrationList(): - self.menuEntries.append([menuEntry, self.prefix + x[:-3]]) - except: - pass - list.append((picturepath, pluginname , x[:-3])) + for x in dir: + path = resolveFilename(SCOPE_PLUGINS, x) + "/" + if os.path.exists(path): + if fileExists(path + "plugin.py"): + pluginmodule = self.prefix + x + ".plugin" + print "trying to import " + pluginmodule + exec "import " + pluginmodule + plugin = eval(pluginmodule) + picturepath = plugin.getPicturePath() + pluginname = plugin.getPluginName() + try: + for menuEntry in plugin.getMenuRegistrationList(): + self.menuEntries.append([menuEntry, pluginmodule]) + except: + pass + + list.append((picturepath, pluginname , x)) self.menuUpdate() return list @@ -44,8 +48,8 @@ class PluginComponent: def runPlugin(self, plugin, session): try: - exec "import " + self.prefix + plugin[2] - eval(self.prefix + plugin[2]).main(session) + exec "import " + self.prefix + plugin[2] + ".plugin" + eval(self.prefix + plugin[2] + ".plugin").main(session) except: print "exec of plugin failed!" diff --git a/lib/python/Plugins/Makefile.am b/lib/python/Plugins/Makefile.am index 47e6cec2..21dcb9c8 100644 --- a/lib/python/Plugins/Makefile.am +++ b/lib/python/Plugins/Makefile.am @@ -1,7 +1,8 @@ installdir = $(LIBDIR)/enigma2/python/Plugins +SUBDIRS = update + install_PYTHON = \ - __init__.py \ - update.py \ - update.png + __init__.py + diff --git a/lib/python/Plugins/update.png b/lib/python/Plugins/update/Makefile.am index e69de29b..e69de29b 100644 --- a/lib/python/Plugins/update.png +++ b/lib/python/Plugins/update/Makefile.am diff --git a/lib/python/Plugins/update.py b/lib/python/Plugins/update/update.png index e69de29b..e69de29b 100644 --- a/lib/python/Plugins/update.py +++ b/lib/python/Plugins/update/update.png diff --git a/lib/python/Tools/Directories.py b/lib/python/Tools/Directories.py index 37ff1aa4..3736b7b5 100644 --- a/lib/python/Tools/Directories.py +++ b/lib/python/Tools/Directories.py @@ -9,6 +9,7 @@ SCOPE_USERETC = 5 SCOPE_CONFIG = 6 SCOPE_LANGUAGE = 7 SCOPE_HDD = 8 +SCOPE_PLUGINS = 9 PATH_CREATE = 0 PATH_DONTCREATE = 1 @@ -18,6 +19,7 @@ defaultPaths = { SCOPE_SYSETC: ("/etc/", PATH_DONTCREATE), SCOPE_FONTS: ("/usr/share/fonts/", PATH_DONTCREATE), SCOPE_CONFIG: ("/etc/enigma2/", PATH_CREATE), + SCOPE_PLUGINS: ("/usr/lib/enigma2/python/Plugins/", PATH_CREATE), SCOPE_LANGUAGE: ("/usr/share/enigma2/po/", PATH_CREATE), |
