Check-in [41291d31ab]
Overview
Comment: | User standard pluginconf.dependency() for themes filtering. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
41291d31ab45580921d7672a79ea0ae0 |
User & Date: | mario on 2016-12-26 20:27:55 |
Other Links: | manifest | tags |
Context
2016-12-26
| ||
20:42 | Exempt `%` from Win quoting. check-in: 837517237c user: Oliver tags: trunk | |
20:27 | User standard pluginconf.dependency() for themes filtering. check-in: 41291d31ab user: mario tags: trunk | |
15:56 | Introduce `depends:` field for themes as well (no version support, just basenames for linux/windows/gtk2/gtk3) check-in: 7027676c80 user: mario tags: trunk | |
Changes
Modified contrib/theme_installer.py from [ffc788c6a2] to [1a05b24e01].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + - - - - - - + + | # encoding: UTF-8 # api: streamtuner2 # title: Gtk2 theme installer # description: Shows themes in the bookmarks pane for installation # type: feature # category: ui |
︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | + | import os, shutil import csv import zipfile import re import json import ahttp from config import * from config import pluginconf import uikit from compat2and3 import * import action import channels.favicon as fi # register a key |
︙ | |||
123 124 125 126 127 128 129 | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - + - - - + - - - - - - - | state = "gtk-zoom-fit", format = self.mime, listformat = "href" ) # add r.append(d) |
︙ | |||
217 218 219 220 221 222 223 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | + + + + + + + + + + + + + + + + | if dll: self.clear_dll(dll) # delete theme engine dll def clear_dll(self, dll): for fn in dll: os.remove(self.theme_dir + fn) # instantiate pluginconf.dependency() def deps(self, theme): d = pluginconf.dependency() d.have.update(dict([name, {"version": str(ver)}] for name,ver in [ ("gtk", ".".join(str(i) for i in uikit.gtk.gtk_version)), ("gtk2", "2" if uikit.ver == 2 else "-1"), ("gtk3", "3" if uikit.ver == 3 else "-1"), ("linux", "-1" if conf.windows else "4.0.0"), ("win32", "6.1" if conf.windows else "-1") ])) #log.HAVE(dict((k,d.have[k].get("version")) for k in d.have)) self.deps = d.depends return self.deps(theme) |
Modified pluginconf.py from [1a7e07fce3] to [69c2b6a573].
︙ | |||
395 396 397 398 399 400 401 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - + + | # # In practice there's little need for full-blown dependency resolving # for application-level modules. # class dependency(object): # prepare list of known plugins and versions |
︙ | |||
457 458 459 460 461 462 463 464 465 466 467 468 469 470 | 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | + | ">=": curr >= ver, "<=": curr <= ver, "==": curr == ver, ">": curr > ver, "<": curr < ver, "!=": curr != ver, } #log.VERSION_COMPARE(name, " → (", curr, op, ver, ") == ", r) r &= tbl.get(op, True) return r # Add plugin defaults to conf.* store # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # Utility function which applies plugin meta data to a config |
︙ |