IntBool
- class ase2sprkkr.common.grammar_types.basic.IntBool(prefix=None, postfix=None, format='', after_format=None, default_value=None, condition=None, after_convert=None, description='', reversed=False)[source]
A bool type, whose value is represented by a letter (1 or 0)
Class hierarchy
Constructor
- Parameters
prefix (Optional[str]) –
postfix (Optional[str]) –
format (str) –
after_format (Optional[str]) –
default_value (Any) –
condition (Optional[Callable[[Any], Union[bool, str]]]) –
after_convert (Optional[Callable[[Any], Any]]) –
- __init__(prefix=None, postfix=None, format='', after_format=None, default_value=None, condition=None, after_convert=None, description='', reversed=False)[source]
- Parameters
reversed – “reversed integer-boolean” returns 1 if it is False
prefix (Optional[str]) –
postfix (Optional[str]) –
format (str) –
after_format (Optional[str]) –
default_value (Any) –
condition (Optional[Callable[[Any], Union[bool, str]]]) –
after_convert (Optional[Callable[[Any], Any]]) –
- _grammar = {'1' | '0'}
- Parameters
name (Optional[str]) –
- Return type
ParserElement
- _rev_grammar = {'1' | '0'}
- Parameters
name (Optional[str]) –
- Return type
ParserElement
- grammar_name()[source]
Human readable expression of the grammar. By default, this is what is set by grammar.setName, however, sometimes is desirable to set even shorter string
- _string(val)[source]
Convert the value to the ouput.
The
string()
apply format and do some additional transformation (add prefix, postfix etc.), so the actual way how to convert the value for the output should be here.
- I = <IntBool>