Overview
| Comment: | predefine conf[plugins], note .base(__package__) as example |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
94218baefa5b84533ea19fba16bb5dbb |
| User & Date: | mario on 2022-11-01 23:30:00 |
| Other Links: | manifest | tags |
Context
|
2022-11-01
| ||
| 23:30 | shift warning for undiscoverable modules check-in: 18c5918a6d user: mario tags: trunk | |
| 23:30 | predefine conf[plugins], note .base(__package__) as example check-in: 94218baefa user: mario tags: trunk | |
| 23:29 | use dict.pop() instead of get+del check-in: 900b323b25 user: mario tags: trunk | |
Changes
Modified pluginconf/bind.py from [f6f6f09ee5] to [eb3faffd0a].
1 2 3 4 5 | 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 | - + - + - + + + | # encoding: utf-8 # api: pluginconf ##type: loader # title: plugin loader # description: implements a trivial unified namespace importer |
| ︙ | |||
80 81 82 83 84 85 86 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - - - - + + + + + - + - + - - - |
#
# With PySimpleGUI, `conf` could be a psg.UserSettings("app.json") for
# automatic settings+update storage, btw.
#
#-- bit briefer for API docs --
"""
|
| ︙ | |||
235 236 237 238 239 240 241 242 243 244 245 246 247 248 | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | + + |
Traverse installed plugins and expand config dict with presets 🧩 🧾
| Parameters | | |
|-------------|-----------|-------------------------------------------|
| conf | dict 🔁 | Expands the conf dict with preset values from any plugins. |
| **Returns** | None | - |
"""
if not "plugins" in conf:
conf["plugins"] = dict()
for name, pmd in pluginconf.all_plugin_meta().items():
pluginconf.add_plugin_defaults(conf, conf["plugins"], pmd, name)
# pylint: disable=invalid-name
class isolated():
"""
|
| ︙ | |||
293 294 295 296 297 298 299 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | - + |
def defaults():
""" *return* defaults for isolated plugin structure 🧩 🧾 """
conf = {"plugins": {}}
defaults(conf)
return conf
|
| ︙ |