mewlo.mpacks.core.helpers.cfgmodule module Helper class that can load multiple python modules and smartly return an attribute from them in precedence order

class mewlo.mpacks.core.helpers.cfgmodule.MCfgModule[source]

Bases: dict

Lookup values smartly in one of multiple python modules, found dynamically.

get_value(key, defaultval=None)[source]

Walk all of our imports and return first one that has the key.

load_configfiles(configname, pkgdirimp_config)[source]

Load the config files (some may not be found), in order of precedence, with default last.


Load and add a config file module. It’s ok if it’s missing

run_allfuncs(functionname, *args, **kwargs)[source]

Walk imports in reverse order and run function in ALL. Return the number of functions run.

run_func(functionname, *args, **kwargs)[source]

Walk imports and run the first priority config file that has the function. Return the return value of the function, otherwise None if not found.

Table Of Contents

Previous topic

mewlo.mpacks.core.helpers.callables module

Next topic

mewlo.mpacks.core.helpers.debugging module

This Page