45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# API
Lookup configuration is currently just done through injection:
plugin_base = [__package__, "myapp.plugins", "/usr/share/app/extensions"]
module_base = "pluginconf" # or any top-level app module
Which declares module and plugin basenames, which get used for lookups by
just module= names in e.g. `module_list()`. (Works for literal setups
and within PYZ bundles).
This is unnecessary for plain `plugin_meta(fn=)` extraction.
#### [plugin_meta](https://fossil.include-once.org/pluginspec/doc/trunk/html/index.html)( module= | filename= | src= | frame= )
|
|
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# API
Lookup configuration is currently just done through injection:
plugin_base = [__package__, "myapp.plugins", "/usr/share/app/extensions"]
data_base = "pluginconf" # or any top-level app module
Which declares module and plugin basenames, which get used for lookups by
just module= names in e.g. `module_list()`. (Works for literal setups
and within PYZ bundles).
This is unnecessary for plain `plugin_meta(fn=)` extraction.
#### [plugin_meta](https://fossil.include-once.org/pluginspec/doc/trunk/html/index.html)( module= | filename= | src= | frame= )
|
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#### add_plugin_defaults()
Populates your config_options{} and plugin_states{} list. Can be a classic dict,
or one of the hundreds of config parser/managers. You might want to combine
config options and plugin states in a single dict even:
import pluginconf
pluginconf.module_base = __name__
pluginconf.plugin_base = [__package__]
conf = {
"defaults": "123",
"plugins": {} # ← stores the activation states
}
|
|
|
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#### add_plugin_defaults()
Populates your config_options{} and plugin_states{} list. Can be a classic dict,
or one of the hundreds of config parser/managers. You might want to combine
config options and plugin states in a single dict even:
import pluginconf
pluginconf.data_base = __name__
pluginconf.plugin_base = [__package__]
conf = {
"defaults": "123",
"plugins": {} # ← stores the activation states
}
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
It can be invoked via `flit-pluginconf build` / `python -m pluginconf.flit build`
or even `python -m build`. Field mapping isn't very robust yet, and mercilessly
flaunts the `dynamic=` directive.
## other modules
* `pluginconf.depends` provides `Check` for .valid() and .depends() probing
* argparse_map() might also end up in a separate module.
#### Caveats
* It’s mostly just an excerpt from streamtuner2.
* Might need customization prior use.
|
|
>
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
It can be invoked via `flit-pluginconf build` / `python -m pluginconf.flit build`
or even `python -m build`. Field mapping isn't very robust yet, and mercilessly
flaunts the `dynamic=` directive.
# other modules
* `pluginconf.depends` provides `Check` for .valid() and .depends() probing
* `pluginconf.bind` is a simpler interface and basic plugin loader
* argparse_map() might also end up in a separate module.
#### Caveats
* It’s mostly just an excerpt from streamtuner2.
* Might need customization prior use.
|