Plugin-Examples icon indicating copy to clipboard operation
Plugin-Examples copied to clipboard

Example of how to retrieve settings from Non SettingsPlugin classes?

Open eaton opened this issue 7 years ago • 1 comments

I'm creating a variation on the Comment Remover plugin, but it also needs a handful of settings. octoprint.filemanager.util.LineProcessorStream doesn't appear to have easy access to self._settings, though, so retrieving them when it's time to actually process things is a bit tricky.

Is there a recommended/correct way to retrieve them outside of the plugin class itself?

eaton avatar Mar 14 '18 16:03 eaton

I'd subclass the utility class and provide the settings object as a constructor parameter to the subclass instance.

foosel avatar Mar 14 '18 18:03 foosel