1
2
3
4
5
6
7
8
9
10
|
Provides meta data extraction and plugin basename lookup. And it’s meant for
in-application feature and option management.
The [descriptor format](https://fossil.include-once.org/pluginspec/index)
(*self-contained* atop each script) is basically:
# encoding: utf-8
# api: python
# type: handler
# category: io
# title: Plugin configuration
|
|
|
1
2
3
4
5
6
7
8
9
10
|
Provides meta data extraction and plugin basename lookup. And it’s meant for
in-application feature and option management.
The [descriptor format](https://fossil.include-once.org/pluginspec/)
(*self-contained* atop each script) is basically:
# encoding: utf-8
# api: python
# type: handler
# category: io
# title: Plugin configuration
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
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( module= | filename= | src= | frame= )
Returns a meta data dictionary for the given module name, file, source code, or caller frame:
{
"title": "Compound★",
"description": "...",
"version": "0.1",
|
|
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
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= )
Returns a meta data dictionary for the given module name, file, source code, or caller frame:
{
"title": "Compound★",
"description": "...",
"version": "0.1",
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
requires = ["flit_core", "pluginconf"]
build-backend = "pluginconf.flit"
[project]
name = "projectname"
It can be invoked via `python -m pluginconf.flit build` or even
`flit-pluginconf build`. It's not very robust however.
## other modules
* DependencyValidation is now in `pluginconf.depends`
* argparse_map() might also end up in a separate module.
#### Caveats
* It’s mostly just an excerpt from streamtuner2.
* Might need customization prior use.
|
|
|
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
requires = ["flit_core", "pluginconf"]
build-backend = "pluginconf.flit"
[project]
name = "projectname"
It can be invoked via `python -m pluginconf.flit build` or even
`flit-pluginconf build`. Field mapping isn't very robust yet.
## 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.
|