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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
<dd>
<div class="desc"><p>checkbox for plugin name</p></div>
</dd>
<dt id="pluginconf.gui.plugin_layout"><code class="name flex">
<span>def <span class="ident">plugin_layout</span></span>(<span>pmd_list, config, plugin_states, opt_label=False)</span>
</code></dt>
<dd>
<div class="desc"><p>craft list of widgets for each read plugin</p></div>
</dd>
<dt id="pluginconf.gui.read_options"><code class="name flex">
<span>def <span class="ident">read_options</span></span>(<span>files)</span>
</code></dt>
<dd>
<div class="desc"><p>read files, return dict of {id:pmd} for all plugins</p></div>
</dd>
<dt id="pluginconf.gui.window"><code class="name flex">
<span>def <span class="ident">window</span></span>(<span>config, plugin_states, files=['*/*.py'], **kwargs)</span>
</code></dt>
<dd>
<div class="desc"><p>Reads *.py files and crafts a settings dialog from meta data.</p>
<p>Where <code>plugin_states{}</code> is usually an entry in <code>config{}</code> itself. Depending on plugin
and option names, it might even be a flat/shared namespace for both. Per default you'd
set <code>files=["plugins/*.py", __file__]</code> to be read. But with <code>files=[]</code> it's possible to
provide a <code>plugins=pluginconf.get_plugin_meta()</code> or prepared plugin/options dict instead.</p>
<h2 id="parameters">Parameters</h2>
<dl>
<dt><strong><code>config</code></strong> : <code>dict 🔁</code></dt>
<dd>Config settings, updated after dialog completion</dd>
<dt><strong><code>plugin_states</code></strong> : <code>dict 🔁</code></dt>
<dd>Plugin activation states, also input/output</dd>
<dt><strong><code>files</code></strong> : <code>list</code></dt>
<dd>Glob list of *.py files to extract meta definitions from</dd>
<dt><strong><code>plugins</code></strong> : <code>dict</code></dt>
<dd>Alternatively to files=[] list, a preparsed list of pluginmeta+config dicts can be injected</dd>
<dt><strong><code>opt_label</code></strong> : <code>bool</code></dt>
<dd>Show config name= as label</dd>
<dt><strong><code>theme</code></strong> : <code>str</code></dt>
<dd>Set PSG window theme.</dd>
<dt><strong><code>**kwargs</code></strong> : <code>dict</code></dt>
<dd>Other options are passed on to PySimpleGUI</dd>
</dl>
<h2 id="returns">Returns</h2>
<dl>
<dt><strong><code>True</code></strong> : <code>if changed config{} values are to be saved (the dict will be updated in any case)</code></dt>
<dd> </dd>
</dl></div>
</dd>
<dt id="pluginconf.gui.wrap"><code class="name flex">
<span>def <span class="ident">wrap</span></span>(<span>text, width=50)</span>
</code></dt>
<dd>
<div class="desc"><p>textwrap for <code>description</code> and <code>help</code> option fields</p></div>
</dd>
|
|
>
>
>
|
>
>
|
>
>
>
>
|
|
>
>
|
>
|
>
>
|
>
|
>
>
|
>
|
>
>
|
>
|
>
>
|
>
|
>
>
|
>
|
|
>
|
|
|
|
>
|
|
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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
<dd>
<div class="desc"><p>checkbox for plugin name</p></div>
</dd>
<dt id="pluginconf.gui.plugin_layout"><code class="name flex">
<span>def <span class="ident">plugin_layout</span></span>(<span>pmd_list, config, plugin_states, opt_label=False)</span>
</code></dt>
<dd>
<div class="desc"><p>craft list of widgets: *( <code><a title="pluginconf.gui.plugin_entry" href="#pluginconf.gui.plugin_entry">plugin_entry()</a></code>, *<code><a title="pluginconf.gui.option_entry" href="#pluginconf.gui.option_entry">option_entry()</a></code> )</p></div>
</dd>
<dt id="pluginconf.gui.read_options"><code class="name flex">
<span>def <span class="ident">read_options</span></span>(<span>files)</span>
</code></dt>
<dd>
<div class="desc"><p>read files, return dict of {id:pmd} for all plugins</p></div>
</dd>
<dt id="pluginconf.gui.window"><code class="name flex">
<span>def <span class="ident">window</span></span>(<span>config, plugin_states, files=['*/*.py'], **kwargs)</span>
</code></dt>
<dd>
<div class="desc"><p>Reads *.py files and crafts a settings dialog from meta data.</p>
<p>Where <code>plugin_states{}</code> is usually an entry in <code>config{}</code> itself. Depending on plugin
and option names, it might even be a flat/shared namespace for both. Per default you'd
set <code>files=["plugins/*.py", __file__]</code> to be read. But with <code>files=[]</code> it's possible to
provide a <code>plugins=pluginconf.get_plugin_meta()</code> or prepared plugin/options dict instead.</p>
<table>
<thead>
<tr>
<th>Params</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>config</td>
<td>dict 🔁</td>
<td>Config settings, updated after dialog completion</td>
</tr>
<tr>
<td>plugin_states</td>
<td>dict 🔁</td>
<td>Plugin activation states, also input/output</td>
</tr>
<tr>
<td>files</td>
<td>list</td>
<td>Glob list of *.py files to extract meta definitions from</td>
</tr>
<tr>
<td>plugins</td>
<td>dict</td>
<td>Alternatively to files=[] list, a preparsed list of pluginmeta+config dicts can be injected</td>
</tr>
<tr>
<td>opt_label</td>
<td>bool</td>
<td>Show config name= as label (instead of description)</td>
</tr>
<tr>
<td>theme</td>
<td>str</td>
<td>Set PSG window theme.</td>
</tr>
<tr>
<td>**kwargs</td>
<td>dict</td>
<td>Other options are passed on to PySimpleGUI</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td>True</td>
<td>if updated config{} values should be [Saved]</td>
</tr>
</tbody>
</table></div>
</dd>
<dt id="pluginconf.gui.wrap"><code class="name flex">
<span>def <span class="ident">wrap</span></span>(<span>text, width=50)</span>
</code></dt>
<dd>
<div class="desc"><p>textwrap for <code>description</code> and <code>help</code> option fields</p></div>
</dd>
|