Comment: | introduce plugin_icon() for gui window |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
64c2c6032235797f96f05e6c3cb69464 |
User & Date: | mario on 2022-11-12 15:25:51 |
Other Links: | manifest | tags |
2022-11-12
| ||
22:58 | decoding fixes for pyinstaller/win setups, default on PluginMeta() for unreadable modules check-in: c996a868e2 user: mario tags: trunk | |
15:25 | introduce plugin_icon() for gui window check-in: 64c2c60322 user: mario tags: trunk | |
2022-11-01
| ||
23:30 | shift warning for undiscoverable modules check-in: 18c5918a6d user: mario tags: trunk | |
Modified html/bind.html from [4883e6f315] to [39b9ec53a9].
1 2 3 4 5 6 7 | 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - - - + + + - - + + - - - - + + + + + - + - + - - - | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="generator" content="pdoc 0.10.0" /> <title>pluginconf.bind API documentation</title> |
99 100 101 102 103 104 105 106 107 108 109 110 111 112 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | + + + + + + | </table> <p>Module should be a package, as in a directory and init <code>plugins/__init__.py</code>. Ideally this module was already imported in main. But parameter may be a string.</p> <p>This could be invoked multiple times for the package name to append further path= arguments (=./contrib/, =/usr/share/app/extenstions/, or a .pyz). Which is functionally identical to declaring <code>__path__</code> in the <code>package/__init__.py</code>.</p></div> </dd> <dt id="pluginconf.bind.cache"><code class="name flex"> <span>def <span class="ident">cache</span></span>(<span>state=True)</span> </code></dt> <dd> <div class="desc"><p>Reduce plugin_meta() lookup costs, suitable for repeat find() calls</p></div> </dd> <dt id="pluginconf.bind.defaults"><code class="name flex"> <span>def <span class="ident">defaults</span></span>(<span>conf)</span> </code></dt> <dd> <div class="desc"><p>Traverse installed plugins and expand config dict with presets 🧩 🧾</p> <table> <thead> |
287 288 289 290 291 292 293 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | - + + | <ul id="index"> <li><h3>Super-module</h3> <ul> <li><code><a title="pluginconf" href="index.html">pluginconf</a></code></li> </ul> </li> <li><h3><a href="#header-functions">Functions</a></h3> |
Modified html/css.mako from [7d77cf2153] to [3980ce13a3].
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | + + - - + + | } #footer { font-size: .75em; padding: 5px 30px; border-top: 1px solid #ddd; text-align: right; /* darker grey */ |
265 266 267 268 269 270 271 272 | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | + + - - + + - - - + + + | display: inline; padding-left: 1em; } img { max-width: 100%; } /* table bgs */ td, th { |
311 312 313 314 315 316 317 | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | + + - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + | @media screen and (min-width: 700px) { #sidebar { width: 25%; height: 100vh; overflow: auto; position: sticky; top: 0; /* lighter grey */ |
Modified html/depends.html from [8dad0b793d] to [c2de3f1683].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + + | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="generator" content="pdoc 0.10.0" /> <title>pluginconf.depends API documentation</title> <meta name="description" content="Dependency validation and consistency checker for updates" /> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin> <link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin> |
Modified html/flit.html from [f4ec8aad3f] to [d87fb05623].
1 2 3 4 5 6 7 | 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 31 32 | - + - - - + + - + - | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="generator" content="pdoc 0.10.0" /> <title>pluginconf.flit API documentation</title> |
Modified html/gui.html from [8c9d3bdc20] to [5dffdf94a0].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + + | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="generator" content="pdoc 0.10.0" /> <title>pluginconf.gui API documentation</title> <meta name="description" content="PySimpleGUI window to populate config dict via plugin options …" /> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin> <link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin> |
Modified html/index.html from [bd45e395b2] to [a71f8392c8].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + + | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="generator" content="pdoc 0.10.0" /> <title>pluginconf API documentation</title> <meta name="description" content="Plugin meta extraction and module lookup …" /> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin> <link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin> |
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - - - + + + - + - + + + + + + | </td></tr></table> </section> <section> <h2 class="section-title" id="header-submodules">Sub-modules</h2> <dl> <dt><code class="name"><a title="pluginconf.bind" href="bind.html">pluginconf.bind</a></code></dt> <dd> |
150 151 152 153 154 155 156 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - + | <td>dict</td> <td>names to <code><a title="pluginconf.PluginMeta" href="#pluginconf.PluginMeta">PluginMeta</a></code> dict</td> </tr> </tbody> </table></div> </dd> <dt id="pluginconf.get_data"><code class="name flex"> |
230 231 232 233 234 235 236 | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | - + | <span>def <span class="ident">plugin_meta</span></span>(<span>filename=None, src=None, module=None, frame=1, **kwargs)</span> </code></dt> <dd> <div class="desc"><p>Extract plugin meta data block from specified source.</p> <table> <thead> <tr> |
267 268 269 270 271 272 273 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | - + | </tr> <tr> <td>max_length</td> <td>list</td> <td>Maximum size to read from files (6K default).</td> </tr> <tr> |
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | + + + + + | <div class="desc"><p>Plugin meta data as dictionary<code>{}</code>, or alternatively <code>.property</code> access. Returned for each <code><a title="pluginconf.plugin_meta" href="#pluginconf.plugin_meta">plugin_meta()</a></code> result, and individual <code>config:</code> options. Absent <code>.field</code> access resolves to <code>""</code>.</p></div> <h3>Ancestors</h3> <ul class="hlist"> <li>builtins.dict</li> </ul> <h3>Subclasses</h3> <ul class="hlist"> <li><a title="pluginconf.store.ConfStore" href="store.html#pluginconf.store.ConfStore">ConfStore</a></li> </ul> </dd> </dl> </section> </article> <nav id="sidebar"> <h1>Index</h1> <div class="toc"> <ul></ul> </div> <ul id="index"> <li><h3><a href="#header-submodules">Sub-modules</a></h3> <ul> <li><code><a title="pluginconf.bind" href="bind.html">pluginconf.bind</a></code></li> <li><code><a title="pluginconf.depends" href="depends.html">pluginconf.depends</a></code></li> <li><code><a title="pluginconf.flit" href="flit.html">pluginconf.flit</a></code></li> <li><code><a title="pluginconf.gui" href="gui.html">pluginconf.gui</a></code></li> <li><code><a title="pluginconf.setup" href="setup.html">pluginconf.setup</a></code></li> <li><code><a title="pluginconf.store" href="store.html">pluginconf.store</a></code></li> </ul> </li> <li><h3><a href="#header-variables">Global variables</a></h3> <ul class=""> <li><code><a title="pluginconf.config_opt_type_map" href="#pluginconf.config_opt_type_map">config_opt_type_map</a></code></li> <li><code><a title="pluginconf.data_root" href="#pluginconf.data_root">data_root</a></code></li> <li><code><a title="pluginconf.plugin_base" href="#pluginconf.plugin_base">plugin_base</a></code></li> |
Modified html/setup.html from [ac7e57ed41] to [c9bf5bff6c].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + + | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="generator" content="pdoc 0.10.0" /> <title>pluginconf.setup API documentation</title> <meta name="description" content="Expands setuptools.setup() with automatic package description lookup" /> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin> <link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin> <link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin> |
Modified pluginconf/__init__.py from [8fbfda3a70] to [1b5dd2ab14].
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - - - + + + + | # Provides plugin lookup and meta data extraction utility functions. # It's used to abstract module+option management in applications. # For consolidating internal use and external/tool accessibility. # Generally these functions are highly permissive / error tolerant, # to preempt initialization failures for applications. # # The key:value format is language-agnostic. It's basically YAML in |
265 266 267 268 269 270 271 | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | - + - + | # Plugin meta data extraction # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @renamed_arguments({"fn": "filename"}) def plugin_meta(filename=None, src=None, module=None, frame=1, **kwargs): """ Extract plugin meta data block from specified source. |
465 466 467 468 469 470 471 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | - - - + + + | return {val: val for val in rx.select_list.findall(select)} # Comment extraction regexps # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ class rx: """ |
Modified pluginconf/flit.py from [50d8d8a6ee] to [41c5a40dbc].
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + - | # * for setuptools compat a long dynamic field is required (but flit hates it) # dynamic = ["version", "description", "readme", "requires-python", # "license", "keywords", "classifiers", "urls", "entry-points"] # Not sure yet if the pyproject.toml specs allow for reconcilation here. # <https://github.com/pypa/flit/issues/605> """ |
Modified pluginconf/gui.py from [19523612ff] to [3c6e3b23f8].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | # encoding: UTF-8 # api: python ##type: gui # category: io # title: Config GUI # description: Display plugins + options in setup window |
109 110 111 112 113 114 115 116 117 118 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + - - + + | layout = layout + plugin_entry(plg, plugin_states) for opt in plg["config"]: if opt.get("name"): if opt_label: layout.append([sg.T(opt["name"], font=("Sans", 11, "bold"), pad=((50, 0), (7, 0)))]) layout.append(option_entry(opt, config)) return layout def plugin_icon(pmd): """ see if there's any #img:, #png: or #icon: listed (relative filename or inline base64 data) """ size = { "size": [20,20] } for img_fn in {pmd.icon, pmd.png, pmd.img}: if not img_fn: continue if re.match("^[\w/+=\s]{100,}$", img_fn): return [sg.Image(data=img_fn, **size)] if img_fn.find(".") > 0: return [sg.Image(filename=re.sub("[^/]+$", img_fn, pmd.fn), **size)] return [] def plugin_entry(pmd, plugin_states): """ checkbox for plugin name """ |
162 163 164 165 166 167 168 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | - + | widget = [ sg.InputText(key=name, default_text=str(val), size=(6, 1), pad=((50, 0), 3)), sg.Text(wrap(desc, 60), pad=(5, 2), tooltip=tooltip, auto_size_text=1) ] elif typedef == "select": values = opt["select"].values() widget = [ |