Added deprecation warnings to config property
This commit is contained in:
parent
4246746bdc
commit
3299934afb
1 changed files with 11 additions and 3 deletions
|
|
@ -122,7 +122,7 @@ class Microscope:
|
||||||
|
|
||||||
def attach_plugins(self, plugin_maps: list):
|
def attach_plugins(self, plugin_maps: list):
|
||||||
"""
|
"""
|
||||||
Automatically search for plugin maps in self.config, and attach.
|
Automatically search for plugin maps in config, and attach.
|
||||||
"""
|
"""
|
||||||
if plugin_maps:
|
if plugin_maps:
|
||||||
for plugin_map in plugin_maps:
|
for plugin_map in plugin_maps:
|
||||||
|
|
@ -132,7 +132,7 @@ class Microscope:
|
||||||
|
|
||||||
def reload_plugins(self):
|
def reload_plugins(self):
|
||||||
"""
|
"""
|
||||||
Empty the plugin mount and re-attach from self.config.
|
Empty the plugin mount and re-attach from config.
|
||||||
"""
|
"""
|
||||||
logging.info("Tearing down existing PluginMount...")
|
logging.info("Tearing down existing PluginMount...")
|
||||||
self.plugin = PluginMount(self)
|
self.plugin = PluginMount(self)
|
||||||
|
|
@ -245,8 +245,16 @@ class Microscope:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def config(self) -> dict:
|
def config(self) -> dict:
|
||||||
|
logging.warn(
|
||||||
|
"Reading microscope through config property is deprecated.\
|
||||||
|
Please use read_config method instead."
|
||||||
|
)
|
||||||
return self.read_config()
|
return self.read_config()
|
||||||
|
|
||||||
@config.setter
|
@config.setter
|
||||||
def config(self, config: dict) -> None:
|
def config(self, config: dict) -> None:
|
||||||
self.write_config(config)
|
logging.warn(
|
||||||
|
"Setting microscope through config property is deprecated.\
|
||||||
|
Please use apply_config method instead."
|
||||||
|
)
|
||||||
|
self.apply_config(config)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue