Overview
Comment: | update docs |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
33c3bc16bbe751216415710fe11fd32d |
User & Date: | mario on 2022-10-28 21:59:24 |
Other Links: | manifest | tags |
Context
2022-10-28
| ||
22:31 | introduce ConfigList() for config: key access check-in: fec593dcbd user: mario tags: trunk | |
21:59 | update docs check-in: 33c3bc16bb user: mario tags: trunk | |
08:42 | add graphics to docs check-in: e8bd4d1278 user: mario tags: trunk | |
Changes
Modified html/flit.html from [a3bfda8900] to [105608d01f].
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 | - + + - + + + + + + + + + + | <!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/index.html from [9982a8f1ca] to [381d830594].
︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 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 47 48 49 50 51 52 | + + + + + + + - + + | <main> <article id="content"> <header> <h1 class="title">Package <code>pluginconf</code></h1> </header> <section id="section-intro"> <p>Plugin meta extraction and module lookup</p> <ul> <li>Main function <code>plugin_meta(filename=…)</code> unpacks <a href="https://fossil.include-once.org/pluginspec/">meta fields</a> into dictionaries.</li> <li>Other utility code is about module location, but requires some initialization.</li> </ul> <p><img alt="#" src="https://fossil.include-once.org/pluginspec/logo"></p> </section> <section> <h2 class="section-title" id="header-submodules">Sub-modules</h2> <dl> <dt><code class="name"><a title="pluginconf.depends" href="depends.html">pluginconf.depends</a></code></dt> <dd> <div class="desc"><p>Dependency validation and consistency checker for updates</p></div> </dd> <dt><code class="name"><a title="pluginconf.flit" href="flit.html">pluginconf.flit</a></code></dt> <dd> |
︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | + + + + + + + + + + + + + | <dt><strong><code>conf_plugins</code></strong> : <code>dict : input/output</code></dt> <dd>enable status based on plugin state/priority:</dd> <dt><strong><code>meta</code></strong> : <code>dict</code></dt> <dd>input plugin meta data (invoke once per plugin)</dd> <dt><strong><code>module</code></strong> : <code>str</code></dt> <dd>basename of meta: blocks plugin file</dd> </dl></div> </dd> <dt id="pluginconf.all_plugin_meta"><code class="name flex"> <span>def <span class="ident">all_plugin_meta</span></span>(<span>)</span> </code></dt> <dd> <div class="desc"><p>This is a trivial wrapper to assemble a complete dictionary of available/installed plugins. It associates each plugin name with a its meta{} fields.</p> <h2 id="returns">Returns</h2> <dl> <dt><strong><code>dict</code></strong> : <code>names to meta data dict</code></dt> <dd> </dd> </dl></div> </dd> <dt id="pluginconf.get_data"><code class="name flex"> <span>def <span class="ident">get_data</span></span>(<span>filename, decode=False, gzip=False, file_base=None)</span> </code></dt> <dd> <div class="desc"><p>Fetches file content from install path or from within PYZ archive. This is just an alias and convenience wrapper for |
︙ | |||
116 117 118 119 120 121 122 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + | <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 different sources:</p> <h2 id="parameters">Parameters</h2> <dl> <dt><strong><code>filename</code></strong> : <code>str</code></dt> |
Modified pluginconf/__init__.py from [9d008566c9] to [40c0c39483].
︙ | |||
78 79 80 81 82 83 84 85 86 87 88 89 90 91 | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + + + + + + | # # Using a plugin_state config dictionary in most cases can just list # module basenames, if there's only one namespace to manage. (Plugin # names unique across project.) """ Plugin meta extraction and module lookup * Main function `plugin_meta(filename=…)` unpacks [meta fields](https://fossil.include-once.org/pluginspec/) into dictionaries. * Other utility code is about module location, but requires some initialization.  """ import sys import os |
︙ | |||
103 104 105 106 107 108 109 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - + + | def gzip_decode(bytestr): """ haphazard workaround """ return zlib.decompress(bytestr, 16 + zlib.MAX_WBITS) import zipfile import argparse __all__ = [ |
︙ | |||
249 250 251 252 253 254 255 | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | - + - + - + - + - + - + - + | def plugin_meta(filename=None, src=None, module=None, frame=1, **kwargs): """ Extract plugin meta data block from different sources: Parameters ---------- filename : str |
︙ | |||
312 313 314 315 316 317 318 | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | - + | # Comment and field extraction logic # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @renamed_arguments({"fn": "filename"}) def plugin_meta_extract(src="", filename=None, literal=False): """ Finds the first comment block. Splits key:value header fields from comment. Turns everything into an dict, with |
︙ | |||
355 356 357 358 359 360 361 | 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | - + + - + + + + - + | # Split comment block if src.find("\n\n") > 0: src, meta["doc"] = src.split("\n\n", 1) # Turn key:value lines into dictionary for field in rx.keyval.findall(src): |
︙ |
Modified pluginconf/flit.py from [2a83c6ef38] to [fd547f8d0f].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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 47 48 49 50 51 52 53 54 55 | - - - - - - - - - - - + - + + + + + + + - - + + + + + + | # encoding: utf-8 # api: pep517 # title: flit backend # description: wraps flit_core.buildapi # version: 0.3 # depends: python:flit (>=3.0, <4.0) # license: BSD-3-Clause # priority: extra # pylint: disable=unused-import, wrong-import-position, wrong-import-order # # As alternative to pluginconf.setup, this module is using flit as # pep517 build backend. But adding automagic field lookup of course. # |
︙ | |||
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | + + | get_requires_for_build_editable, prepare_metadata_for_build_wheel, prepare_metadata_for_build_editable, build_wheel, build_editable, build_sdist, ) import flit_core.buildapi # also permit backend="pluginconf.flit:buildapi" del inject # omit from docs #-- invocation point from flit import main if __name__ == "__main__": # os.environ["FLIT_ALLOW_INVALID"] = 1 # alternative to patch_flit_config? main(sys.argv) |
Modified test/basic.py from [4798865c44] to [268d6cd46f].
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 | - + | def title_(pmd): assert pmd["title"] == "basic PMD" def doc_(pmd): assert pmd["doc"] == "This the doc." |