Limnoria icon indicating copy to clipboard operation
Limnoria copied to clipboard

Allow reloading config options that use registry.OnlySomeStrings

Open jlu5 opened this issue 5 years ago • 2 comments
trafficstars

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.

jlu5 avatar May 26 '20 20:05 jlu5

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

progval avatar May 26 '20 21:05 progval

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

progval avatar May 26 '20 21:05 progval