From 08e972ae07f60852a888c93199319444e8c06714 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 23 Feb 2006 02:39:31 +0000 Subject: [PATCH] append, don't overwrite __init__.py files reread plugin list revisited --- lib/python/Components/PluginComponent.py | 8 +++++++- lib/python/Screens/PluginBrowser.py | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py index f3cd7e1e..e55bbd4d 100644 --- a/lib/python/Components/PluginComponent.py +++ b/lib/python/Components/PluginComponent.py @@ -34,6 +34,11 @@ class PluginComponent: if x == PluginDescriptor.WHERE_AUTOSTART: plugin(reason=1) + def reReadPluginList(self, directory, depth = 1): + print "re-reading plugin list" + self.clearPluginList() + self.readPluginList(directory=directory, depth=depth) + def readPluginList(self, directory, modules = [], depth = 1): """enumerates plugins""" @@ -59,7 +64,7 @@ class PluginComponent: p.updateIcon(path) self.addPlugin(p); else: - open(path + "__init__.py", "w").close() + open(path + "__init__.py", "a").close() self.readPluginList(path, modules + [x], depth - 1) def getPlugins(self, where): @@ -75,6 +80,7 @@ class PluginComponent: def clearPluginList(self): self.pluginList = [] + self.plugins = {} def shutdown(self): for p in self.pluginList[:]: diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py index 75599c2b..a21dde80 100644 --- a/lib/python/Screens/PluginBrowser.py +++ b/lib/python/Screens/PluginBrowser.py @@ -112,8 +112,7 @@ class PluginDownloadBrowser(Screen): self.container.execute("ipkg update") def installFinished(self): - plugins.clearPluginList() - plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) + plugins.reReadPluginList(resolveFilename(SCOPE_PLUGINS)) self.close() def runFinished(self, retval): -- 2.30.2