Package pluginconf

Plugin meta extraction and module lookup

Sub-modules

pluginconf.depends

Dependency validation and consistency checker for updates

pluginconf.flit

monkeypatches flint to use pluginconf sources for packaging

pluginconf.gui

PySimpleGUI window to populate config dict via plugin options

pluginconf.setup

Simulates setuptools.setup()

Functions

def add_plugin_defaults(conf_options, conf_plugins, meta, module='')

Utility function which collect defaults from plugin meta data to a config store. Which in the case of streamtuner2 is really just a dictionary conf{} and a plugin list in conf.plugins{}.

Parameters

conf_options : dict : input/output
storage for amassed options
conf_plugins : dict : input/output
enable status based on plugin state/priority:
meta : dict
input plugin meta data (invoke once per plugin)
module : str
basename of meta: blocks plugin file
def get_data(filename, decode=False, gzip=False, file_base=None)

Fetches file content from install path or from within PYZ archive. This is just an alias and convenience wrapper for pkgutil.get_data(). Utilizes the module_base / plugin_base as top-level reference.

Parameters

filename :  str
filename in pyz or bundle
decode : bool
text file decoding utf-8
gzip : bool
automatic gzdecode
file_base : list
alternative base module reference

Returns

str : file contents
 
def module_list(extra_paths=None)

Search through ./plugins/ (and other configured plugin_base names → paths) and get module basenames.

Parameters

extra_paths : list
in addition to plugin_base list

Returns

list : names of found plugins
 
def plugin_meta(filename=None, src=None, module=None, frame=1, **kwargs)

Extract plugin meta data block from different sources:

Parameters

filename : str
read literal files, or .pyz contents
src : str
from already uncovered script code
module : str
lookup per pkgutil, from plugin_base or top-level modules
frame : int
extract comment header of caller (default)
extra_base : list
additional search directories
max_length : list
maximum size to read from files

Returns

dict : key-value pairs of comment fields, config: preparsed