ConfigManager¶
-
class
ConfigManager
¶ Helper class to handle vpype’s TOML configuration files.
This class is typically used via its singleton instance
CONFIG_MANAGER
:>>> from vpype import CONFIG_MANAGER >>> my_config = CONFIG_MANAGER.config.get("my_config", None)
Helper methods are provided for specific aspects of configuration, such as command-specific configs or HPGL-related configs.
By default, built-in configuration packaged with vpype are loaded at startup. If a file exists at path
~/.vpype.toml
, it will be loaded as well. Additionaly files may be loaded using theload_config_file()
method.Methods
Initialize self.
Returns the configuration for command
name
.Returns a
PlotterConfig
instance for plottername
.Returns a list of plotter names whose configuration is available.
Load a config file and add its content to the configuration database.
Attributes
list of weak references to the object (if defined)
Methods¶
-
ConfigManager.
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
ConfigManager.
get_command_config
(name)¶ Returns the configuration for command
name
.
-
ConfigManager.
get_plotter_config
(name)¶ Returns a
PlotterConfig
instance for plottername
.- Parameters
name (
Optional
[str
]) -- name of desired plotter (may beNone
, in which caseNone
is returned)- Return type
Optional
[PlotterConfig
]- Returns
PlotterConfig
instance or None if not found
-
ConfigManager.
get_plotter_list
()¶ Returns a list of plotter names whose configuration is available.
Attributes¶
-
ConfigManager.
__dict__
= mappingproxy({'__module__': 'vpype.config', '__doc__': 'Helper class to handle vpype\'s TOML configuration files.\n\n This class is typically used via its singleton instance ``CONFIG_MANAGER``::\n\n >>> from vpype import CONFIG_MANAGER\n >>> my_config = CONFIG_MANAGER.config.get("my_config", None)\n\n Helper methods are provided for specific aspects of configuration, such as command-specific\n configs or HPGL-related configs.\n\n By default, built-in configuration packaged with vpype are loaded at startup. If a file\n exists at path ``~/.vpype.toml``, it will be loaded as well. Additionaly files may be\n loaded using the :func:`load_config_file` method.\n ', '__init__': <function ConfigManager.__init__>, 'load_config_file': <function ConfigManager.load_config_file>, 'get_plotter_list': <function ConfigManager.get_plotter_list>, 'get_plotter_config': <function ConfigManager.get_plotter_config>, 'get_command_config': <function ConfigManager.get_command_config>, 'config': <property object>, '__dict__': <attribute '__dict__' of 'ConfigManager' objects>, '__weakref__': <attribute '__weakref__' of 'ConfigManager' objects>})¶
-
ConfigManager.
__doc__
= 'Helper class to handle vpype\'s TOML configuration files.\n\n This class is typically used via its singleton instance ``CONFIG_MANAGER``::\n\n >>> from vpype import CONFIG_MANAGER\n >>> my_config = CONFIG_MANAGER.config.get("my_config", None)\n\n Helper methods are provided for specific aspects of configuration, such as command-specific\n configs or HPGL-related configs.\n\n By default, built-in configuration packaged with vpype are loaded at startup. If a file\n exists at path ``~/.vpype.toml``, it will be loaded as well. Additionaly files may be\n loaded using the :func:`load_config_file` method.\n '¶
-
ConfigManager.
__module__
= 'vpype.config'¶
-
ConfigManager.
__weakref__
¶ list of weak references to the object (if defined)