New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose package_metadata_reader to allzparkconfig #35
Comments
Implemented. For example, implementing backwards compatibility can be done like so: ~/marcus/allzparkconfig.py def read_package_data(package):
# Augment existing data
data = allzparkconfig._read_package_data(package)
# Backwards compatibility with old system
backwards_icon = getattr(package, "_icons", {}).get("32x32")
backwards_icon = backwards_icon or data.get("icons", {}).get("32x32")
data["icon"] = data["icon"] or backwards_icon or ""
return data |
Icons are currently presumed to be a string template, with 3 keys. Example icon = "{root}/any/path/{width}x{height}.png"
icon = "{root}/any/path/{w}x{h}.png" # Alternatively It's questionable whether we need to override at this level of granularity, but in case icons are coming from elsewhere or integrating with a third-party system then odds are Allzpark would need to conform to it rather than vice versa. That's open for discussion should that happen. There could alternatively be a specific mechanism for returning a fully qualified |
Goal
Enable customisation of how metadata is gathered from a given package.
Motivation
Metadata is currently presumed to exist within a package as a
_data
dictionary variable.There are a few issues with that.
_data
is free for us to claim; the user may already be using it for something else.package.py
. It may come from a side-car file or database, in which case the package may be be used as merely an indicator of where to find it (e.g. by name/version combination)Implementation
Expose the current reader to
allzparkconfig.py
.To facilitate lengthy queries, make the call asynchronous from within Allzpark.
The text was updated successfully, but these errors were encountered: