Check-in [686c553354]
Overview
Comment: | Moved dependency() into pluginconf module, which shortens adding new installable modules to the vbox. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
686c553354b682a4c1a5388817c677a9 |
User & Date: | mario on 2015-05-04 15:23:32 |
Other Links: | manifest | tags |
Context
2015-05-04
| ||
17:45 | No more API. check-in: 5cd371d6e5 user: mario tags: trunk | |
15:23 | Moved dependency() into pluginconf module, which shortens adding new installable modules to the vbox. check-in: 686c553354 user: mario tags: trunk | |
15:22 | Make configwin construction slightly more readable, use new pluginconf functions. check-in: 5f8afee363 user: mario tags: trunk | |
Changes
Modified channels/pluginmanager2.py from [978f889bbd] to [a43e06b214].
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # # Actually rather trivial. The Gtk interface building just # makes this handler look complicated. import imp import config import pkgutil from channels import __path__ as channels__path__ import os from config import * from uikit import * import ahttp import json | > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # # Actually rather trivial. The Gtk interface building just # makes this handler look complicated. import imp import config import pluginconf import pkgutil from channels import __path__ as channels__path__ import os from config import * from uikit import * import ahttp import json |
︙ | ︙ | |||
124 125 126 127 128 129 130 | d = ahttp.get(url, encoding='utf-8') or [] meta += json.loads(d) self.parent.status() # Clean up placeholders in vbox _ = [self.vbox.remove(c) for c in self.vbox.get_children()[3:]] | < < | < < < < < < < < < | | | > | | | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | d = ahttp.get(url, encoding='utf-8') or [] meta += json.loads(d) self.parent.status() # Clean up placeholders in vbox _ = [self.vbox.remove(c) for c in self.vbox.get_children()[3:]] # Attach available downloads after checking dependencies # e.g. newpl["depends"] = "streamtuner2 < 2.2.0, config >= 2.5" dep = pluginconf.dependency() for newpl in meta: if dep.valid(newpl) and dep.depends(newpl): self.add_plugin(newpl) # Readd some filler labels _ = [self.add_(uikit.label("")) for i in range(1,3)] # Entry for plugin list def add_plugin(self, p): b = self.button("Install", stock="gtk-save", cb=lambda *w:self.install(p)) p = self.update_p(p) text = "<b>$title</b>, "\ "<small>version:</small> <span weight='bold' color='orange'>$version</span>, "\ "<small>type: <i><span color='#559'>$type</span></i> "\ "category: <i><span color='blue'>$category</span></i></small>\n"\ "<span size='smaller' color='#364'>$description</span>\n"\ "<span size='small' color='#532' weight='ultralight'>$extras, <a href='view-source:$file'>view src</a></span>" self.add_(b, safe_format(text, **p), markup=1) # Add placeholder fields def update_p(self, p): fields = ("status", "priority", "support", "author", "depends") |
︙ | ︙ | |||
206 207 208 209 210 211 212 213 | log.WARN("Cannot disable feature plugin '{}'.".format(name)) p.status("Disabling feature plugins requires a restart.") # just let main load any new plugins p.load_plugin_channels() | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 197 198 199 200 201 202 203 204 205 206 207 208 209 | log.WARN("Cannot disable feature plugin '{}'.".format(name)) p.status("Disabling feature plugins requires a restart.") # just let main load any new plugins p.load_plugin_channels() # Alternative to .format(), with keys possibly being absent from string import Template def safe_format(str, **kwargs): return Template(str).safe_substitute(**kwargs) |
Modified st2.py from [f3bb2fc332] to [5d8e044644].
︙ | ︙ | |||
348 349 350 351 352 353 354 | del cn.stations()[ n ] cn.switch() cn.save() # Alternative Notebook channel tabs between TOP and LEFT position def switch_notebook_tabs_position(self, w, pos): self.notebook_channels.set_tab_pos(pos); | < | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | del cn.stations()[ n ] cn.switch() cn.save() # Alternative Notebook channel tabs between TOP and LEFT position def switch_notebook_tabs_position(self, w, pos): self.notebook_channels.set_tab_pos(pos); # Shortcut to statusbar and progressbar (receives either a string, or a float). def status(self, text=None, timeout=3): self.status_last = time.time() + timeout |
︙ | ︙ |