robot.parsing.model package
Submodules
robot.parsing.model.blocks module
- classrobot.parsing.model.blocks.Container[source]
Bases:
Node,ABC- propertylineno:int
- propertycol_offset:int
- propertyend_lineno:int
- propertyend_col_offset:int
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.File(sections:Sequence[Section]=(),source:Path|None=None,languages:Sequence[str]=())[source]
Bases:
Container
- classrobot.parsing.model.blocks.Block(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Container,ABC
- classrobot.parsing.model.blocks.Section(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Block- header:SectionHeader|None
- classrobot.parsing.model.blocks.SettingSection(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Section- header:SectionHeader
- classrobot.parsing.model.blocks.VariableSection(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Section- header:SectionHeader
- classrobot.parsing.model.blocks.TestCaseSection(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Section- header:SectionHeader
- propertytasks:bool
- classrobot.parsing.model.blocks.KeywordSection(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Section- header:SectionHeader
- classrobot.parsing.model.blocks.CommentSection(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Section- header:SectionHeader|None
- classrobot.parsing.model.blocks.ImplicitCommentSection(header:Statement|None=None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
CommentSection- header:None
- classrobot.parsing.model.blocks.InvalidSection(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Section
- classrobot.parsing.model.blocks.TestCase(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Block- header:TestCaseName
- propertyname:str
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.Keyword(header:Statement|None,body:Sequence[Statement|Block]=(),errors:Sequence[str]=())[source]
Bases:
Block- header:KeywordName
- propertyname:str
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.NestedBlock(header:Statement,body:Sequence[Statement|Block]=(),end:End|None=None,errors:Sequence[str]=())[source]
Bases:
Block
- classrobot.parsing.model.blocks.If(header:Statement,body:Sequence[Statement|Block]=(),orelse:If|None=None,end:End|None=None,errors:Sequence[str]=())[source]
Bases:
NestedBlockRepresents IF structures in the model.
Used with IF, Inline IF, ELSE IF and ELSE nodes. The
typeattributespecifies the type.- header:IfHeader|ElseIfHeader|ElseHeader
- propertytype:str
- propertycondition:str|None
- propertyassign:tuple[str,...]
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.For(header:Statement,body:Sequence[Statement|Block]=(),end:End|None=None,errors:Sequence[str]=())[source]
Bases:
NestedBlock- propertyassign:tuple[str,...]
- propertyvariables:tuple[str,...]
- propertyvalues:tuple[str,...]
- propertyflavor:str|None
- propertystart:str|None
- propertymode:str|None
- propertyfill:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.Try(header:Statement,body:Sequence[Statement|Block]=(),next:Try|None=None,end:End|None=None,errors:Sequence[str]=())[source]
Bases:
NestedBlock- propertytype:str
- propertypatterns:tuple[str,...]
- propertypattern_type:str|None
- propertyassign:str|None
- propertyvariable:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.While(header:Statement,body:Sequence[Statement|Block]=(),end:End|None=None,errors:Sequence[str]=())[source]
Bases:
NestedBlock- header:WhileHeader
- propertycondition:str
- propertylimit:str|None
- propertyon_limit:str|None
- propertyon_limit_message:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.Group(header:Statement,body:Sequence[Statement|Block]=(),end:End|None=None,errors:Sequence[str]=())[source]
Bases:
NestedBlock- header:GroupHeader
- propertyname:str
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.blocks.ModelWriter(output:Path|str|TextIO)[source]
Bases:
ModelVisitor
- classrobot.parsing.model.blocks.ModelValidator[source]
Bases:
ModelVisitor
- classrobot.parsing.model.blocks.ValidationContext[source]
Bases:
object- propertytasks:bool
- propertyin_keyword:bool
- propertyin_loop:bool
- propertyin_finally:bool
- classrobot.parsing.model.blocks.FirstStatementFinder[source]
Bases:
ModelVisitor
- classrobot.parsing.model.blocks.LastStatementFinder[source]
Bases:
ModelVisitor
robot.parsing.model.statements module
- classrobot.parsing.model.statements.Node[source]
Bases:
AST,ABC- lineno:int
- col_offset:int
- end_lineno:int
- end_col_offset:int
- errors:tuple[str,...]=()
- classrobot.parsing.model.statements.Statement(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Node,ABC- type:str
- handles_types:ClassVar[tuple[str,...]]=()
- statement_handlers:ClassVar[dict[str,Type[Statement]]]={'ARGUMENT':<class'robot.parsing.model.statements.TemplateArguments'>,'ARGUMENTS':<class'robot.parsing.model.statements.Arguments'>,'BREAK':<class'robot.parsing.model.statements.Break'>,'COMMENT':<class'robot.parsing.model.statements.Comment'>,'COMMENTHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'CONFIG':<class'robot.parsing.model.statements.Config'>,'CONTINUE':<class'robot.parsing.model.statements.Continue'>,'DEFAULTTAGS':<class'robot.parsing.model.statements.DefaultTags'>,'DOCUMENTATION':<class'robot.parsing.model.statements.Documentation'>,'ELSE':<class'robot.parsing.model.statements.ElseHeader'>,'ELSEIF':<class'robot.parsing.model.statements.ElseIfHeader'>,'END':<class'robot.parsing.model.statements.End'>,'ERROR':<class'robot.parsing.model.statements.Error'>,'EXCEPT':<class'robot.parsing.model.statements.ExceptHeader'>,'FINALLY':<class'robot.parsing.model.statements.FinallyHeader'>,'FOR':<class'robot.parsing.model.statements.ForHeader'>,'GROUP':<class'robot.parsing.model.statements.GroupHeader'>,'IF':<class'robot.parsing.model.statements.IfHeader'>,'INLINEIF':<class'robot.parsing.model.statements.InlineIfHeader'>,'INVALIDHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'KEYWORD':<class'robot.parsing.model.statements.KeywordCall'>,'KEYWORDHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'KEYWORDNAME':<class'robot.parsing.model.statements.KeywordName'>,'KEYWORDTAGS':<class'robot.parsing.model.statements.KeywordTags'>,'LIBRARY':<class'robot.parsing.model.statements.LibraryImport'>,'METADATA':<class'robot.parsing.model.statements.Metadata'>,'RESOURCE':<class'robot.parsing.model.statements.ResourceImport'>,'RETURN':<class'robot.parsing.model.statements.ReturnSetting'>,'RETURNSTATEMENT':<class'robot.parsing.model.statements.Return'>,'SETTINGHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'SETUP':<class'robot.parsing.model.statements.Setup'>,'SUITENAME':<class'robot.parsing.model.statements.SuiteName'>,'SUITESETUP':<class'robot.parsing.model.statements.SuiteSetup'>,'SUITETEARDOWN':<class'robot.parsing.model.statements.SuiteTeardown'>,'TAGS':<class'robot.parsing.model.statements.Tags'>,'TASKHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'TEARDOWN':<class'robot.parsing.model.statements.Teardown'>,'TEMPLATE':<class'robot.parsing.model.statements.Template'>,'TESTSETUP':<class'robot.parsing.model.statements.TestSetup'>,'TESTTAGS':<class'robot.parsing.model.statements.TestTags'>,'TESTTEARDOWN':<class'robot.parsing.model.statements.TestTeardown'>,'TESTTEMPLATE':<class'robot.parsing.model.statements.TestTemplate'>,'TESTTIMEOUT':<class'robot.parsing.model.statements.TestTimeout'>,'TESTCASEHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'TESTCASENAME':<class'robot.parsing.model.statements.TestCaseName'>,'TIMEOUT':<class'robot.parsing.model.statements.Timeout'>,'TRY':<class'robot.parsing.model.statements.TryHeader'>,'VAR':<class'robot.parsing.model.statements.Var'>,'VARIABLE':<class'robot.parsing.model.statements.Variable'>,'VARIABLEHEADER':<class'robot.parsing.model.statements.SectionHeader'>,'VARIABLES':<class'robot.parsing.model.statements.VariablesImport'>,'WHILE':<class'robot.parsing.model.statements.WhileHeader'>}
- options:dict[str,tuple|None]={}
- propertylineno:int
- propertycol_offset:int
- propertyend_lineno:int
- propertyend_col_offset:int
- classmethodregister(subcls:Type[T])→Type[T][source]
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
- classmethodfrom_tokens(tokens:Sequence[Token])→Statement[source]
Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement, not fromits subclasses. If you know the subclass to use, simply create aninstance of it directly.
- abstractmethodclassmethodfrom_params(*args,**kwargs)→Statement[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- get_token(*types:str)→Token|None[source]
Return a token with any of the given
types.If there are no matches, return
None. If there are multiplematches, return the first match.
- get_value(type:str,default:str)→str[source]
- get_value(type:str,default:None=None)→str|None
Return value of a token with the given
type.If there are no matches, return
default. If there are multiplematches, return the value of the first match.
- get_option(name:str,default:str|None=None)→str|None[source]
Return value of a configuration option with the given
name.If the option has not been used, return
default.If the option has been used multiple times, values are joined together.This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.DocumentationOrMetadata(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement,ABC- propertyvalue:str
- classrobot.parsing.model.statements.SingleValue(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement,ABC- propertyvalue:str|None
- classrobot.parsing.model.statements.MultiValue(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement,ABC- propertyvalues:tuple[str,...]
- classrobot.parsing.model.statements.Fixture(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement,ABC- propertyname:str
- propertyargs:tuple[str,...]
- classrobot.parsing.model.statements.SectionHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- handles_types:ClassVar[tuple[str,...]]=('SETTINGHEADER','VARIABLEHEADER','TESTCASEHEADER','TASKHEADER','KEYWORDHEADER','COMMENTHEADER','INVALIDHEADER')
- classmethodfrom_params(type:str,name:str|None=None,eol:str='\n')→SectionHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertytype:str
- propertyname:str
- classrobot.parsing.model.statements.LibraryImport(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='LIBRARY'
- classmethodfrom_params(name:str,args:Sequence[str]=(),alias:str|None=None,separator:str=' ',eol:str='\n')→LibraryImport[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- propertyargs:tuple[str,...]
- propertyalias:str|None
- classrobot.parsing.model.statements.ResourceImport(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='RESOURCE'
- classmethodfrom_params(name:str,separator:str=' ',eol:str='\n')→ResourceImport[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- classrobot.parsing.model.statements.VariablesImport(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='VARIABLES'
- classmethodfrom_params(name:str,args:Sequence[str]=(),separator:str=' ',eol:str='\n')→VariablesImport[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- propertyargs:tuple[str,...]
- classrobot.parsing.model.statements.Documentation(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
DocumentationOrMetadata- type:str='DOCUMENTATION'
- classmethodfrom_params(value:str,indent:str=' ',separator:str=' ',eol:str='\n',settings_section:bool=True)→Documentation[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Metadata(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
DocumentationOrMetadata- type:str='METADATA'
- classmethodfrom_params(name:str,value:str,separator:str=' ',eol:str='\n')→Metadata[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- classrobot.parsing.model.statements.TestTags(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
MultiValue- type:str='TESTTAGS'
- classmethodfrom_params(values:Sequence[str],separator:str=' ',eol:str='\n')→TestTags[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.DefaultTags(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
MultiValue- type:str='DEFAULTTAGS'
- classmethodfrom_params(values:Sequence[str],separator:str=' ',eol:str='\n')→DefaultTags[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.KeywordTags(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
MultiValue- type:str='KEYWORDTAGS'
- classmethodfrom_params(values:Sequence[str],separator:str=' ',eol:str='\n')→KeywordTags[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.SuiteName(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
SingleValue- type:str='SUITENAME'
- classmethodfrom_params(value:str,separator:str=' ',eol:str='\n')→SuiteName[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.SuiteSetup(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Fixture- type:str='SUITESETUP'
- classmethodfrom_params(name:str,args:Sequence[str]=(),separator:str=' ',eol:str='\n')→SuiteSetup[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.SuiteTeardown(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Fixture- type:str='SUITETEARDOWN'
- classmethodfrom_params(name:str,args:Sequence[str]=(),separator:str=' ',eol:str='\n')→SuiteTeardown[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.TestSetup(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Fixture- type:str='TESTSETUP'
- classmethodfrom_params(name:str,args:Sequence[str]=(),separator:str=' ',eol:str='\n')→TestSetup[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.TestTeardown(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Fixture- type:str='TESTTEARDOWN'
- classmethodfrom_params(name:str,args:Sequence[str]=(),separator:str=' ',eol:str='\n')→TestTeardown[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.TestTemplate(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
SingleValue- type:str='TESTTEMPLATE'
- classmethodfrom_params(value:str,separator:str=' ',eol:str='\n')→TestTemplate[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.TestTimeout(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
SingleValue- type:str='TESTTIMEOUT'
- classmethodfrom_params(value:str,separator:str=' ',eol:str='\n')→TestTimeout[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Variable(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='VARIABLE'
- options:dict[str,tuple|None]={'separator':None}
- classmethodfrom_params(name:str,value:str|Sequence[str],value_separator:str|None=None,separator:str=' ',eol:str='\n')→Variable[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- propertyvalue:tuple[str,...]
- propertyseparator:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.TestCaseName(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='TESTCASENAME'
- classmethodfrom_params(name:str,eol:str='\n')→TestCaseName[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.KeywordName(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='KEYWORDNAME'
- classmethodfrom_params(name:str,eol:str='\n')→KeywordName[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.Setup(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Fixture- type:str='SETUP'
- classmethodfrom_params(name:str,args:Sequence[str]=(),indent:str=' ',separator:str=' ',eol:str='\n')→Setup[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Teardown(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Fixture- type:str='TEARDOWN'
- classmethodfrom_params(name:str,args:Sequence[str]=(),indent:str=' ',separator:str=' ',eol:str='\n')→Teardown[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Tags(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
MultiValue- type:str='TAGS'
- classmethodfrom_params(values:Sequence[str],indent:str=' ',separator:str=' ',eol:str='\n')→Tags[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Template(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
SingleValue- type:str='TEMPLATE'
- classmethodfrom_params(value:str,indent:str=' ',separator:str=' ',eol:str='\n')→Template[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Timeout(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
SingleValue- type:str='TIMEOUT'
- classmethodfrom_params(value:str,indent:str=' ',separator:str=' ',eol:str='\n')→Timeout[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Arguments(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
MultiValue- type:str='ARGUMENTS'
- classmethodfrom_params(args:Sequence[str],indent:str=' ',separator:str=' ',eol:str='\n')→Arguments[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.ReturnSetting(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
MultiValueRepresents the deprecated
[Return]setting.This class was named
Returnprior to Robot Framework 7.0. A forwardcompatibleReturnSettingalias existed already in Robot Framework 6.1.- type:str='RETURN'
- classmethodfrom_params(args:Sequence[str],indent:str=' ',separator:str=' ',eol:str='\n')→ReturnSetting[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.KeywordCall(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='KEYWORD'
- classmethodfrom_params(name:str,assign:Sequence[str]=(),args:Sequence[str]=(),indent:str=' ',separator:str=' ',eol:str='\n')→KeywordCall[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertykeyword:str
- propertyargs:tuple[str,...]
- propertyassign:tuple[str,...]
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.TemplateArguments(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='ARGUMENT'
- classmethodfrom_params(args:Sequence[str],indent:str=' ',separator:str=' ',eol:str='\n')→TemplateArguments[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyargs:tuple[str,...]
- classrobot.parsing.model.statements.ForHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='FOR'
- options:dict[str,tuple|None]={'fill':None,'mode':('STRICT','SHORTEST','LONGEST'),'start':None}
- classmethodfrom_params(assign:Sequence[str],values:Sequence[str],flavor:Literal['IN','INRANGE','INENUMERATE','INZIP']='IN',indent:str=' ',separator:str=' ',eol:str='\n')→ForHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyassign:tuple[str,...]
- propertyvariables:tuple[str,...]
- propertyvalues:tuple[str,...]
- propertyflavor:str|None
- propertystart:str|None
- propertymode:str|None
- propertyfill:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.IfElseHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement,ABC- propertycondition:str|None
- propertyassign:tuple[str,...]
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.IfHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
IfElseHeader- type:str='IF'
- classmethodfrom_params(condition:str,indent:str=' ',separator:str=' ',eol:str='\n')→IfHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.InlineIfHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
IfElseHeader- type:str='INLINEIF'
- classmethodfrom_params(condition:str,assign:Sequence[str]=(),indent:str=' ',separator:str=' ')→InlineIfHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.ElseIfHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
IfElseHeader- type:str='ELSEIF'
- classmethodfrom_params(condition:str,indent:str=' ',separator:str=' ',eol:str='\n')→ElseIfHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.ElseHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
IfElseHeader- type:str='ELSE'
- classmethodfrom_params(indent:str=' ',eol:str='\n')→ElseHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.NoArgumentHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement,ABC- classmethodfrom_params(indent:str=' ',eol:str='\n')[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- validate(ctx:ValidationContext)[source]
- propertyvalues:tuple[str,...]
- classrobot.parsing.model.statements.TryHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
NoArgumentHeader- type:str='TRY'
- classrobot.parsing.model.statements.ExceptHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='EXCEPT'
- options:dict[str,tuple|None]={'type':('GLOB','REGEXP','START','LITERAL')}
- classmethodfrom_params(patterns:Sequence[str]=(),type:str|None=None,assign:str|None=None,indent:str=' ',separator:str=' ',eol:str='\n')→ExceptHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertypatterns:tuple[str,...]
- propertypattern_type:str|None
- propertyassign:str|None
- propertyvariable:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.FinallyHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
NoArgumentHeader- type:str='FINALLY'
- classrobot.parsing.model.statements.End(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
NoArgumentHeader- type:str='END'
- classrobot.parsing.model.statements.WhileHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='WHILE'
- options:dict[str,tuple|None]={'limit':None,'on_limit':('PASS','FAIL'),'on_limit_message':None}
- classmethodfrom_params(condition:str,limit:str|None=None,on_limit:str|None=None,on_limit_message:str|None=None,indent:str=' ',separator:str=' ',eol:str='\n')→WhileHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertycondition:str
- propertylimit:str|None
- propertyon_limit:str|None
- propertyon_limit_message:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.GroupHeader(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='GROUP'
- classmethodfrom_params(name:str='',indent:str=' ',separator:str=' ',eol:str='\n')→GroupHeader[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.Var(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='VAR'
- options:dict[str,tuple|None]={'scope':('LOCAL','TEST','TASK','SUITE','SUITES','GLOBAL'),'separator':None}
- classmethodfrom_params(name:str,value:str|Sequence[str],scope:str|None=None,value_separator:str|None=None,indent:str=' ',separator:str=' ',eol:str='\n')→Var[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyname:str
- propertyvalue:tuple[str,...]
- propertyscope:str|None
- propertyseparator:str|None
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.Return(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
StatementRepresents the RETURN statement.
This class named
ReturnStatementprior to Robot Framework 7.0.The old name still exists as a backwards compatible alias.- type:str='RETURNSTATEMENT'
- classmethodfrom_params(values:Sequence[str]=(),indent:str=' ',separator:str=' ',eol:str='\n')→Return[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyvalues:tuple[str,...]
- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.LoopControl(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
NoArgumentHeader,ABC- validate(ctx:ValidationContext)[source]
- classrobot.parsing.model.statements.Continue(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
LoopControl- type:str='CONTINUE'
- classrobot.parsing.model.statements.Break(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
LoopControl- type:str='BREAK'
- classrobot.parsing.model.statements.Comment(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='COMMENT'
- classmethodfrom_params(comment:str,indent:str=' ',eol:str='\n')→Comment[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Config(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='CONFIG'
- classmethodfrom_params(config:str,eol:str='\n')→Config[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- classrobot.parsing.model.statements.Error(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='ERROR'
- classmethodfrom_params(error:str,value:str='',indent:str=' ',eol:str='\n')→Error[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
- propertyvalues:list[str]
- classrobot.parsing.model.statements.EmptyLine(tokens:Sequence[Token],errors:Sequence[str]=())[source]
Bases:
Statement- type:str='EOL'
- classmethodfrom_params(eol:str='\n')[source]
Create a statement from passed parameters.
Required and optional arguments in general match class properties.Values are used to create matching tokens.
Most implementations support following general properties:
separatorwhitespace inserted between each token. Default is four spaces.indentwhitespace inserted before first token. Default is four spaces.eolend of line sign. Default is'\n'.
This classmethod should be called from the
Statementsubclassto create, not from theStatementclass itself.
robot.parsing.model.visitor module
- classrobot.parsing.model.visitor.ModelVisitor[source]
Bases:
NodeVisitor,VisitorFinderNodeVisitor that supports matching nodes based on their base classes.
The biggest difference compared to the standardast.NodeVisitor,is that this class allows creating
visit_ClassNamemethods so thattheClassNameis one of the base classes of the node. For example,the following visitor method matches all node classes that extendStatement:defvisit_Statement(self,node):...
Another difference is that visitor methods are cached for performancereasons. This means that dynamically adding
visit_Somethingmethodsdoes not work.
- classrobot.parsing.model.visitor.ModelTransformer[source]
Bases:
NodeTransformer,VisitorFinderNodeTransformer that supports matching nodes based on their base classes.
See
ModelVisitorfor explanation how this is different comparedto the standardast.NodeTransformer.