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.

get(*, require_signals: bool = True) Database
word_length_in_bits

Each instance of this class represents a setting which can be changed in a config file.

This class implements the descriptor protocol to return value if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

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 to parser.

message: db.MessageSpec | None = None
run_parsed(args: Namespace) None

This is an abstract method which must be implemented by subclasses.

class serialtools.database_config.Param(config_file: ConfigFile)

Bases: ConfigFileArgparseCommand

Define a parameter that can be used in the message command.

defined_parameters: dict[str, db.ByteSpec] = {}
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 to parser.

parse_allowed_values(allowed_values: str | None, length: int | str | None) Sequence[bytes] | None
run_parsed(args: Namespace) None

This is an abstract method which must be implemented by subclasses.

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 to parser.

run_parsed(args: Namespace) None

This is an abstract method which must be implemented by subclasses.

signals: list[db.Signal] = []
serialtools.database_config.get_database(*, require_signals: bool = True) Database
serialtools.database_config.integer(val: str) int