Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Normalise name and description fields with language codes #4

Closed
odscjames opened this issue Jun 29, 2018 · 3 comments · Fixed by #25
Closed

Normalise name and description fields with language codes #4

odscjames opened this issue Jun 29, 2018 · 3 comments · Fixed by #25
Assignees

Comments

@odscjames
Copy link
Contributor

Some earlier versions of the extensions did not have language codes, so that currently we get

"bids": {
            "versions": {
                "v1.1.1": {
                    "name": "Bid statistics and details",
                    "description": "Allowing bid statistics, and detailed bid information to be represented."
                },
                "v1.1": {
                    "name": "Bid statistics and details",
                    "description": "Allowing bid statistics, and detailed bid information to be represented."
                },
                "v1.1.3": {
                    "name": {
                        "en": "Bid statistics and details"
                    },
                    "description": {
                        "en": "Allowing bid statistics, and detailed bid information to be represented."
                    }
                },

The output of this package should be normalized so there is always a language code there.

@odscjames odscjames self-assigned this Jun 29, 2018
@jpmckinney
Copy link
Member

jpmckinney commented Jun 29, 2018

One implementation option would be to add a method to ExtensionVersion in extension_registry.py to normalize the metadata in extension.json. If so, in terms of API, I think it makes sense for the existing .metadata() method to return normalized output (so that users don't need to know that metadata format changed across time), and to perhaps add a .raw_metadata() method to access the original metadata.

@odscjames
Copy link
Contributor Author

I have done this as a seperate def for now, with a note saying it could be pushed upstream.

I agree it would be good to, but there is a slight problem to overcome first in that the code upstream will always download the file, or use it's in memory cache. In this package we store files to disk, and I've already got it so that in some cases it re-uses the files on disk between runs, thus saving downloads and time.

There was a comment elsewhere about extracting code upstream - I'm sure it can be done with a little thought about the API design. Will bear this case in mind.

@jpmckinney
Copy link
Member

For sure - it will likely be simpler to consider API changes once this repo's needs are fleshed out through further implementation :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants