sublime_music.adapters.configure_server_form module
This file contains all of the classes related for a shared server configuration form.
- class sublime_music.adapters.configure_server_form.ConfigParamDescriptor(type, description, required=True, helptext=None, advanced=None, default=None, numeric_bounds=None, numeric_step=None, options=None, pathtype=None)[source]
Bases:
objectDescribes a parameter that can be used to configure an adapter. The
description,requiredanddefault:should be self-evident as to what they do.The
helptextparameter is optional detailed text that will be shown in a help bubble corresponding to the field.The
typemust be one of the following:The literal type
str: corresponds to a freeform text entry field in the UI.The literal type
bool: corresponds to a toggle in the UI.The literal type
int: corresponds to a numeric input in the UI.The literal string
"password": corresponds to a password entry field in the UI.The literal string
"option": corresponds to dropdown in the UI.The literal type
Path: corresponds to a file picker in the UI.
The
advancedparameter specifies whether the setting should be behind an “Advanced” expander.The
numeric_boundsparameter only has an effect if thetypeis int. It specifies the min and max values that the UI control can have.The
numeric_stepparameter only has an effect if thetypeis int. It specifies the step that will be taken using the “+” and “-” buttons on the UI control (if supported).The
optionsparameter only has an effect if thetypeis"option". It specifies the list of options that will be available in the dropdown in the UI.The
pathtypeparameter only has an effect if thetypeisPath. It can be either"file"or"directory"corresponding to a file picker and a directory picker, respectively.- Parameters
- Return type
None
- __init__(type, description, required=True, helptext=None, advanced=None, default=None, numeric_bounds=None, numeric_step=None, options=None, pathtype=None)
- Parameters
- Return type
None
- default: Any = None
- class sublime_music.adapters.configure_server_form.ConfigureServerForm(config_store, config_parameters, verify_configuration, is_networked=True)[source]
Bases:
gi.overrides.Gtk.Box- Parameters
config_store (sublime_music.adapters.adapter_base.ConfigurationStore) –
config_parameters (Dict[str, sublime_music.adapters.configure_server_form.ConfigParamDescriptor]) –
verify_configuration (Callable[[], Dict[str, Optional[str]]]) –
is_networked (bool) –
- __init__(config_store, config_parameters, verify_configuration, is_networked=True)[source]
Inititialize a
ConfigureServerFormwith the given configuration parameters.- Parameters
config_store (sublime_music.adapters.adapter_base.ConfigurationStore) – The
ConfigurationStoreto use to store configuration values for this adapter.config_parameters (Dict[str, sublime_music.adapters.configure_server_form.ConfigParamDescriptor]) – An dictionary where the keys are the name of the configuration paramter and the values are the
ConfigParamDescriptorobject corresponding to that configuration parameter. The order of the keys in the dictionary correspond to the order that the configuration parameters will be shown in the UI.verify_configuration (Callable[[], Dict[str, Optional[str]]]) –
A function that verifies whether or not the current state of the
config_storeis valid. The output should be a dictionary containing verification errors. The keys of the returned dictionary should be the same as the keys passed in via theconfig_parametersparameter. The values should be strings describing why the corresponding value in theconfig_storeis invalid.If the adapter
is_networked, and the special"__ping__"key is returned, then the error will be shown below all of the other settings in the ping status box.is_networked (bool) – whether or not the adapter is networked.
- had_all_required_keys = False
- verifying_in_progress = False