Skip to content
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

Allow reloading config options that use registry.OnlySomeStrings #1411

Open
jlu5 opened this issue May 26, 2020 · 2 comments
Open

Allow reloading config options that use registry.OnlySomeStrings #1411

jlu5 opened this issue May 26, 2020 · 2 comments

Comments

@jlu5
Copy link
Collaborator

jlu5 commented May 26, 2020

Context: my NuWeather plugin uses an OnlySomeStrings option to define a list of supported weather backends and set the default one. When reloading the plugin, the list of allowed values is not automatically updated - this makes in place updates of the plugin difficult.

@progval
Copy link
Owner

progval commented May 26, 2020

Workaround: override validStrings to be a property that reads a global value that gets reloaded.

@progval
Copy link
Owner

progval commented May 26, 2020

Hmm and you'd need to update __doc__ and errormsg too. Might as well subclass String directly and copy-paste code from OnlySomeStrings.

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

No branches or pull requests

2 participants