Most of this code is based on the ReOBJ package. see LICENSE for more info
These Classes are used for the final default/parsed LCONF object.
Note
after the initialization all of them are in some ways changeable
(Blk)Block Class: LCONF Block-Name class
Has additional attributes:
key_order (list) the keys in order but exclusive Default-Comment/Empty Lines
key_empty_replacementvalue (dict) all keys which have Empty-KeyValuePair-ReplacementValue
if LCONF-Default-Template-Structure defines an Empty-KeyValuePair-ReplacementValue then the key is added with the Empty-KeyValuePair-ReplacementValue
This is needed for LCONF.main_code.lconf_emit() to check if empty_key_value_pair is True
Parameters: |
|
---|
Sets the class __dict__: key to value: if key did not exist it is added
Parameters: |
|
---|
(Blk)Block (I)dentifier Class: LCONF Repeated-Block-Identifier class
Has additional attributes:
key_order (list) the keys (block_names) in order as added - see param block_names_list
min_required_blocks (int) - see param min_required_blocks
max_allowed_blocks (int) - see param max_allowed_blocks
has_comments (bool): defaults to False
- this must be set to True: if it is init with comments: this is needed when a Blk is prepared
Parameters: |
|
---|
Called to implement assignment to self[key]. If block_name is not in key_order it will be added.
Parameters: |
|
---|
Sets the class __dict__: key to value: if key did not exist it is added
Parameters: |
|
---|
(K)ey(V)alueList Class: LCONF Key :: Value-List and Key-Value-List class
Has additional attributes:
use_oneline (bool) will be initialized: default option to emit it as oneline or multiline list
- useful in case the list has many default values or very long values
Parameters: |
|
---|
Sets the class __dict__: key to value: if key did not exist it is added
Parameters: |
|
---|
(K)ey(V)alue(Map)ping Class: LCONF Key-Value-Mappings class
Has additional attributes:
key_order (list) the keys in order but exclusive Default-Comment/Empty Lines
key_empty_replacementvalue (dict) all keys which have Empty-KeyValuePair-ReplacementValue
if LCONF-Default-Template-Structure defines an Empty-KeyValuePair-ReplacementValue then the key is added with the Empty-KeyValuePair-ReplacementValue
This is needed for LCONF.main_code.lconf_emit() to check if empty_key_value_pair is True
Parameters: |
|
---|
Sets the class __dict__: key to value: if key did not exist it is added
Parameters: |
|
---|
Lconf(M)ain/Root Class: LCONF Main/LconfRoot obj class
Has additional attributes:
key_order (list) the keys in order but exclusive Default-Comment/Empty Lines
key_empty_replacementvalue (dict) all keys which have Empty-KeyValuePair-ReplacementValue
if LCONF-Default-Template-Structure defines an Empty-KeyValuePair-ReplacementValue then the key is added with the Empty-KeyValuePair-ReplacementValue
This is needed for LCONF.main_code.lconf_emit() to check if empty_key_value_pair is True
section_name (str) defaults to ‘missing section name’
is_parsed (bool) defaults to False
has_comments (bool) defaults to False
- this must be set to True: if it is init with comments: this helps that one does not need to check for comments later on
Parameters: |
|
---|
Create a new LconfRoot from a pickled dumps.
Parameters: | in_pickle_dumps – (bytes) a pickled LconfRoot dumps |
---|---|
Returns: | (obj) a new LconfRoot object |
Raises Err: |
Sets the class __dict__: key to value: if key did not exist it is added
Parameters: |
|
---|
List(O)f(T)uples Class: LCONF List-Of-Tuples class
Tuple items (rows) should only be simple objects: no nested list, dictionary ect..
Note
to replace column_names use the replace_column_names() as it also updates related things
Has additional attributes:
- column_names (tuple): will be initialized: with column_names
- column_names_idx_lookup (dict): will be initialized: column_name, to tuple_idx mapping
- column_names_counted (int): will be initialized: with the number of column_names
- column_replace_missing (tuple)
Parameters: |
|
---|
Replaces the column_names (tuple) with the new_column_names_tuple
Parameters: | new_column_names_tuple – (tuple) must have the same number of names as the current column_names |
---|---|
Raises Err: |
Sets the class __dict__: key to value: if key did not exist it is added
Parameters: |
|
---|
Returns the items of all rows for the column
Parameters: | column_name – (string) |
---|---|
Returns: | (list) all items of the column for all rows |
Raises Err: |