Index: pluginconf/depends.py ================================================================== --- pluginconf/depends.py +++ pluginconf/depends.py @@ -38,16 +38,16 @@ find_executable = lambda name: False # Minimal depends: probing # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -class Check(object): +class Check(): """ Now this definitely requires customization. Each plugin can carry a list of (soft-) dependency names. - \# depends: config, appcore >= 2.0, bin:wkhtmltoimage, python < 3.5 + … # depends: config, appcore >= 2.0, bin:wkhtmltoimage, python < 3.5 Here only in-application modules are honored, system references ignored. Unknown plugin names are also skipped. A real install helper might want to auto-tick them on, etc. This example is just meant for probing downloadable plugins. @@ -76,11 +76,11 @@ log = logging.getLogger("pluginconf.dependency") # ignore bin:… or python:… package in depends system_deps = False - def __init__(self, add={}, core=["st2", "uikit", "config", "action"]): + def __init__(self, add=None, core=["st2", "uikit", "config", "action"]): """ Prepare list of known plugins and versions in self.have={} Parameters ---------- @@ -93,11 +93,11 @@ self.have = { "python": {"version": sys.version} } # inject virtual modules - for name, meta in add.items(): + for name, meta in (add or {}).items(): if isinstance(meta, bool): meta = 1 if meta else -1 if isinstance(meta, tuple): meta = ".".join(str(n) for n in meta) if isinstance(meta, (int, float, str)):