cmk_graphing.v1

entry_point_prefixes()

Return the types of plug-ins and their respective prefixes that can be discovered by Checkmk.

These types can be used to create plug-ins that can be discovered by Checkmk. To be discovered, the plug-in must be of one of the types returned by this function and its name must start with the corresponding prefix.

Return type:

Mapping[type[Metric | Translation | Perfometer | Bidirectional | Stacked | Graph | Bidirectional], str]

Example:

>>> for plugin_type, prefix in entry_point_prefixes().items():
...     print(f'{prefix}... = {plugin_type.__name__}(...)')
metric_... = Metric(...)
translation_... = Translation(...)
perfometer_... = Perfometer(...)
perfometer_... = Bidirectional(...)
perfometer_... = Stacked(...)
graph_... = Graph(...)
graph_... = Bidirectional(...)
class Title(_arg, *, _modifier=None)

Create a localizable string

The return type of this function marks its argument as “to be localized”. The actual localization is done later by the backend. For this to work, the argument passed to this function needs to be present in the localization file.

Parameters:

string – The string to be localized.

Returns:

An object that can later be translated by the backend.

Examples

This is a simple use case:

>>> title = Title("Translate this title")

Note that the returned type only supports % formatting and addition.

When adding localizables, you must make sure the translations of the individual components are available.

>>> help = Title("Translate this. ") + Title("Translate this separately.")

Sometimes you might want to format individually localized strings, to ensure consistent translations:

>>> help = Title("Please use '%s' for foo") % Title("params for foo")

Be aware that this does not result in an instance of a Title:

>>> "%s!" % Title("hi")
"Title('hi')!"