1 diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py
2 index d423f46..0a029ed 100755
3 --- a/lib/python/Screens/PluginBrowser.py
4 +++ b/lib/python/Screens/PluginBrowser.py
5 @@ -14,6 +14,9 @@ from Tools.LoadPixmap import LoadPixmap
12 def languageChanged():
13 plugins.clearPluginList()
14 plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
15 @@ -179,7 +182,8 @@ class PluginDownloadBrowser(Screen):
16 self.container.execute("opkg update")
17 PluginDownloadBrowser.lastDownloadDate = time()
19 - self.startIpkgListAvailable()
21 + self.startIpkgListInstalled()
22 elif self.type == self.REMOVE:
24 self.startIpkgListInstalled()
25 @@ -198,7 +202,16 @@ class PluginDownloadBrowser(Screen):
26 self.startIpkgListInstalled()
27 elif self.run == 1 and self.type == self.DOWNLOAD:
29 - self.startIpkgListAvailable()
30 + for x in self.getPluginListAvailable():
31 + if x[0] not in self.installedplugins:
32 + self.pluginlist.append(x)
35 + self.pluginlist.sort()
37 + self["list"].instance.show()
39 + self["text"].setText(_("No new plugins found"))
41 if len(self.pluginlist) > 0:
43 @@ -220,17 +233,18 @@ class PluginDownloadBrowser(Screen):
44 self.remainingdata = ""
47 - plugin = x.split(" - ")
48 + plugin = x.split(" - ", 2)
50 - if self.run == 1 and self.type == self.DOWNLOAD:
51 + if plugin[0].startswith('enigma2-plugin-') and not plugin[0].endswith('-dev') and not plugin[0].endswith('-staticdev') and not plugin[0].endswith('-dbg') and not plugin[0].endswith('-doc') and not plugin[0].endswith('-src'):
52 if plugin[0] not in self.installedplugins:
53 - self.installedplugins.append(plugin[0])
55 - if plugin[0] not in self.installedplugins:
56 - plugin.append(plugin[0][15:])
57 + if self.run == 1 and self.type == self.DOWNLOAD:
58 + self.installedplugins.append(plugin[0])
60 + if len(plugin) == 2:
62 + plugin.append(plugin[0][15:])
63 + self.pluginlist.append(plugin)
65 - self.pluginlist.append(plugin)
69 expandableIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/expandable-plugins.png"))
70 @@ -239,13 +253,6 @@ class PluginDownloadBrowser(Screen):
73 for x in self.pluginlist:
75 - split = x[0].split('-',3)
76 - if not self.plugins.has_key(split[2]):
77 - self.plugins[split[2]] = []
78 - self.plugins[split[2]].append((PluginDescriptor(name = x[2], description = " ", icon = verticallineIcon), split[3]))
81 split = x[3].split('-', 1)
84 @@ -263,4 +270,56 @@ class PluginDownloadBrowser(Screen):
86 self["list"].l.setList(list)
88 + def getPluginListAvailable(self):
92 + for fn in glob.glob("/etc/opkg/*-feed.conf"):
93 + feeds.append(open(fn, 'r').read().split()[1])
96 + list_dir = "/var/lib/opkg"
97 + for line in open("/etc/opkg/opkg.conf", 'r'):
98 + if line.startswith('lists_dir'):
99 + list_dir = line.split()[-1]
103 + for line in open(os.path.join(list_dir, feed), 'r'):
104 + if line.startswith("Package:"):
105 + pkg = line.split(":", 1)[1].strip()
106 + if pkg.startswith('enigma2-plugin-') and not pkg.endswith('-dev') and not pkg.endswith('-staticdev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-src'):
112 + if Package is None:
115 + if line.startswith("Version:"):
116 + Version = line.split(":", 1)[1].strip()
118 + elif line.startswith("Description:"):
119 + Description = line.split(":", 1)[1].strip()
121 + elif Description and line.startswith(' '):
122 + Description += line[:-1]
124 + elif len(line) <= 1:
125 + sp = Description.split(' ', 3)
126 + if sp[1] == "version":
127 + Description = sp[3].strip()
129 + pn = Package.split('enigma2-plugin-')[1]
131 + sp = Description.split(' ', 1)
132 + if sp[0] == pn and len(sp[1]) > 0:
133 + Description = sp[1].strip()
135 + plugin_list.append((Package, Version, Description, pn))
140 language.addCallback(languageChanged)