serialtools.database_config module
- class serialtools.database_config.DatabaseCreator
Bases:
object
- endianness
A setting without a default value which requires the user to explicitly set a value in the config file or pass it as command line argument.
You can use
is_value_valid()
in order to check whether this config has a value or not.If you try to use the value before it has been set: If you try to access the config as instance attribute (
object.config
) aTypeError
is thrown. Otherwise (config.value
)None
is returned.
- word_length_in_bits
A setting which can have different values for different objects.
This class implements the descriptor protocol to return one of the values in
values
depending on aconfig_id
attribute of the owning object if an instance of this class is accessed as an instance attribute. If there is no value for theconfig_id
invalues
value
is returned instead. If the owning instance does not have aconfig_id
attribute anAttributeError
is raised.In the config file a group can be opened with
[config-id]
. Then all followingset
commands set the value for the specified config id.
- class serialtools.database_config.LoggingCallback(*, logger: ~logging.Logger = <RootLogger root (WARNING)>, levels: ~collections.abc.Mapping[~confattr.configfile.NotificationLevel, int] = {})
Bases:
object
- class serialtools.database_config.Message(config_file: ConfigFile)
Bases:
ConfigFileArgparseCommand
- init_parser(parser: ArgumentParser) None
- Parameters:
parser¶ – The parser to add arguments to. This is the same object like
parser
.
This is an abstract method which must be implemented by subclasses. Use
ArgumentParser.add_argument()
to add arguments toparser
.
- class serialtools.database_config.Param(config_file: ConfigFile)
Bases:
ConfigFileArgparseCommand
Define a parameter that can be used in the message command.
- init_parser(parser: ArgumentParser) None
- Parameters:
parser¶ – The parser to add arguments to. This is the same object like
parser
.
This is an abstract method which must be implemented by subclasses. Use
ArgumentParser.add_argument()
to add arguments toparser
.
- class serialtools.database_config.Signal(config_file: ConfigFile)
Bases:
ConfigFileArgparseCommand
- init_parser(parser: ArgumentParser) None
- Parameters:
parser¶ – The parser to add arguments to. This is the same object like
parser
.
This is an abstract method which must be implemented by subclasses. Use
ArgumentParser.add_argument()
to add arguments toparser
.