Index: pluginconf/__init__.py ================================================================== --- pluginconf/__init__.py +++ pluginconf/__init__.py @@ -14,10 +14,11 @@ # api-docs: https://fossil.include-once.org/pluginspec/doc/trunk/html/index.html # docs: https://fossil.include-once.org/pluginspec/ # url: http://fossil.include-once.org/streamtuner2/wiki/plugin+meta+data # config: - # format: off +# permissive: 0.75 # pylint: disable=invalid-name # console-scripts: flit-pluginconf=pluginconf.flit:main, pluginconf.flit=pluginconf.flit:main # # Provides plugin lookup and meta data extraction utility functions. # It's used to abstract module+option management in applications. @@ -109,10 +110,11 @@ def gzip_decode(bytestr): """ haphazard workaround """ return zlib.decompress(bytestr, 16 + zlib.MAX_WBITS) import zipfile import argparse +import logging __all__ = [ "plugin_meta", "get_data", "module_list", "add_plugin_defaults", "PluginMeta", "all_plugin_meta", ] @@ -119,11 +121,11 @@ # Injectables # ‾‾‾‾‾‾‾‾‾‾‾ """ injectable callback function for logging """ -log_ERR = lambda *x: None +log = logging.getLogger("pluginconf") """ File lookup relation for get_data(), should name a top-level package. (Equivalent PluginBase(package=…)) """ @@ -197,11 +199,11 @@ data = gzip_decode(data) if decode: return data.decode("utf-8", errors='ignore') return str(data) except: - # log_ERR("get_data() didn't find:", fn, "in", file_base) + log.error("get_data() didn't find:", fn, "in", file_base) pass # Plugin name lookup # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -353,11 +355,11 @@ # Extract coherent comment block src = src.replace("\r", "") if not literal: src = rx.comment.search(src) if not src: - log_ERR("Couldn't read source meta information:", filename) + log.error("Couldn't read source meta information:", filename) return meta src = src.group(0) src = rx.hash.sub("", src).strip() # Split comment block Index: pluginconf/depends.py ================================================================== --- pluginconf/depends.py +++ pluginconf/depends.py @@ -7,10 +7,11 @@ # depends: pluginconf >= 0.7 # version: 0.5 # state: beta # license: PD # priority: optional +# permissive: 0.8 # # This is a rather basic depends: checker, mostly for local and # installable modules. It's largely built around streamtuner2 # requirements, and should be customized. # Index: pluginconf/flit.py ================================================================== --- pluginconf/flit.py +++ pluginconf/flit.py @@ -4,10 +4,11 @@ # description: wraps flit_core.buildapi # version: 0.3 # depends: python:flit (>=3.0, <4.0) # license: BSD-3-Clause # priority: extra +# permissive: 0.1 # 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. # Index: pluginconf/gui.py ================================================================== --- pluginconf/gui.py +++ pluginconf/gui.py @@ -6,10 +6,11 @@ # description: Display plugins + options in setup window # version: 0.8 # depends: python:pysimplegui (>= 4.0) # priority: optional # config: - +# permissive: 0.5 # pylint: disable=line-too-long # # Creates a PySimpleGUI options list. Scans a given list of *.py files # for meta data, then populates a config{} dict and (optionally) a state # map for plugins themselves. Index: pluginconf/setup.py ================================================================== --- pluginconf/setup.py +++ pluginconf/setup.py @@ -3,10 +3,11 @@ ##type: functions # title: setup() wrapper # description: utilizes PMD to populate some package fields # version: 0.5 # license: PD +# permissive: 0.3 # pylint: disable=line-too-long # # Utilizes plugin meta data to cut down setup.py incantations # to basically just: #