A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://robot-framework.readthedocs.org/en/master/autodoc/robot.parsing.model.html below:

Website Navigation


robot.parsing.model package — Robot Framework 7.3.3.dev1 documentation

robot.parsing.model package Submodules robot.parsing.model.blocks module
class robot.parsing.model.blocks.Container[source]

Bases: Node, ABC

property lineno: int
property col_offset: int
property end_lineno: int
property end_col_offset: int
validate_model()[source]
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.File(sections: Sequence[Section] = (), source: Path | None = None, languages: Sequence[str] = ())[source]

Bases: Container

save(output: Path | str | TextIO | None = None)[source]

Save model to the given output or to the original source file.

The output can be a path to a file or an already opened file object. If output is not given, the original source file will be overwritten.

class robot.parsing.model.blocks.Block(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Container, ABC

class robot.parsing.model.blocks.Section(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Block

class robot.parsing.model.blocks.SettingSection(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Section

class robot.parsing.model.blocks.VariableSection(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Section

class robot.parsing.model.blocks.TestCaseSection(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Section

property tasks: bool
class robot.parsing.model.blocks.KeywordSection(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Section

Bases: Section

Bases: CommentSection

class robot.parsing.model.blocks.InvalidSection(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Section

class robot.parsing.model.blocks.TestCase(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Block

property name: str
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.Keyword(header: Statement | None, body: Sequence[Statement | Block] = (), errors: Sequence[str] = ())[source]

Bases: Block

property name: str
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.NestedBlock(header: Statement, body: Sequence[Statement | Block] = (), end: End | None = None, errors: Sequence[str] = ())[source]

Bases: Block

class robot.parsing.model.blocks.If(header: Statement, body: Sequence[Statement | Block] = (), orelse: If | None = None, end: End | None = None, errors: Sequence[str] = ())[source]

Bases: NestedBlock

Represents IF structures in the model.

Used with IF, Inline IF, ELSE IF and ELSE nodes. The type attribute specifies the type.

property type: str
property condition: str | None
property assign: tuple[str, ...]
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.For(header: Statement, body: Sequence[Statement | Block] = (), end: End | None = None, errors: Sequence[str] = ())[source]

Bases: NestedBlock

property assign: tuple[str, ...]
property variables: tuple[str, ...]
property values: tuple[str, ...]
property flavor: str | None
property start: str | None
property mode: str | None
property fill: str | None
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.Try(header: Statement, body: Sequence[Statement | Block] = (), next: Try | None = None, end: End | None = None, errors: Sequence[str] = ())[source]

Bases: NestedBlock

property type: str
property patterns: tuple[str, ...]
property pattern_type: str | None
property assign: str | None
property variable: str | None
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.While(header: Statement, body: Sequence[Statement | Block] = (), end: End | None = None, errors: Sequence[str] = ())[source]

Bases: NestedBlock

property condition: str
property limit: str | None
property on_limit: str | None
property on_limit_message: str | None
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.Group(header: Statement, body: Sequence[Statement | Block] = (), end: End | None = None, errors: Sequence[str] = ())[source]

Bases: NestedBlock

property name: str
validate(ctx: ValidationContext)[source]
class robot.parsing.model.blocks.ModelWriter(output: Path | str | TextIO)[source]

Bases: ModelVisitor

write(model: Node)[source]
visit_Statement(statement: Statement)[source]
class robot.parsing.model.blocks.ModelValidator[source]

Bases: ModelVisitor

visit_Block(node: Block)[source]
visit_Statement(node: Statement)[source]
class robot.parsing.model.blocks.ValidationContext[source]

Bases: object

block(node: Block) Iterator[None][source]
property parent_block: Block | None
property tasks: bool
property in_keyword: bool
property in_loop: bool
property in_finally: bool
class robot.parsing.model.blocks.FirstStatementFinder[source]

Bases: ModelVisitor

classmethod find_from(model: Node) Statement | None[source]
visit_Statement(statement: Statement)[source]
generic_visit(node: Node)[source]

Called if no explicit visitor function exists for a node.

class robot.parsing.model.blocks.LastStatementFinder[source]

Bases: ModelVisitor

classmethod find_from(model: Node) Statement | None[source]
visit_Statement(statement: Statement)[source]
class robot.parsing.model.blocks.TemplatesNotAllowed(kind: str)[source]

Bases: ModelVisitor

check(model: Node)[source]
visit_TemplateArguments(node: None)[source]
robot.parsing.model.statements module
class robot.parsing.model.statements.Node[source]

Bases: AST, ABC

lineno: int
col_offset: int
end_lineno: int
end_col_offset: int
errors: tuple[str, ...] = ()
class robot.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'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <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'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <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'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.Return'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TAGS': <class 'robot.parsing.model.statements.TestTags'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <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'>, 'VARIABLE HEADER': <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] = {}
property lineno: int
property col_offset: int
property end_lineno: int
property end_col_offset: int
classmethod register(subcls: Type[T]) Type[T][source]

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

classmethod from_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 from its subclasses. If you know the subclass to use, simply create an instance of it directly.

abstractmethod classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property data_tokens: list[Token]
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 multiple matches, return the first match.

get_tokens(*types: str) list[Token][source]

Return tokens having any of the given types.

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 multiple matches, return the value of the first match.

get_values(*types: str) tuple[str, ...][source]

Return values of tokens having any of the given types.

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.

property lines: Iterator[list[Token]]
validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.DocumentationOrMetadata(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement, ABC

property value: str
class robot.parsing.model.statements.SingleValue(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement, ABC

property value: str | None
class robot.parsing.model.statements.MultiValue(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement, ABC

property values: tuple[str, ...]
class robot.parsing.model.statements.Fixture(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement, ABC

property name: str
property args: tuple[str, ...]

Bases: Statement

handles_types: ClassVar[tuple[str, ...]] = ('SETTING HEADER', 'VARIABLE HEADER', 'TESTCASE HEADER', 'TASK HEADER', 'KEYWORD HEADER', 'COMMENT HEADER', 'INVALID HEADER')

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.LibraryImport(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'LIBRARY'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
property args: tuple[str, ...]
property alias: str | None
class robot.parsing.model.statements.ResourceImport(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'RESOURCE'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
class robot.parsing.model.statements.VariablesImport(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'VARIABLES'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
property args: tuple[str, ...]
class robot.parsing.model.statements.Documentation(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: DocumentationOrMetadata

type: str = 'DOCUMENTATION'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Metadata(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: DocumentationOrMetadata

type: str = 'METADATA'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
class robot.parsing.model.statements.TestTags(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: MultiValue

type: str = 'TEST TAGS'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.DefaultTags(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: MultiValue

type: str = 'DEFAULT TAGS'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.KeywordTags(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: MultiValue

type: str = 'KEYWORD TAGS'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.SuiteName(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: SingleValue

type: str = 'SUITE NAME'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.SuiteSetup(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Fixture

type: str = 'SUITE SETUP'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.SuiteTeardown(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Fixture

type: str = 'SUITE TEARDOWN'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.TestSetup(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Fixture

type: str = 'TEST SETUP'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.TestTeardown(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Fixture

type: str = 'TEST TEARDOWN'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.TestTemplate(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: SingleValue

type: str = 'TEST TEMPLATE'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.TestTimeout(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: SingleValue

type: str = 'TEST TIMEOUT'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Variable(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'VARIABLE'
options: dict[str, tuple | None] = {'separator': None}
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
property value: tuple[str, ...]
property separator: str | None
validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.TestCaseName(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'TESTCASE NAME'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.KeywordName(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'KEYWORD NAME'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.Setup(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Fixture

type: str = 'SETUP'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Teardown(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Fixture

type: str = 'TEARDOWN'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Tags(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: MultiValue

type: str = 'TAGS'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Template(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: SingleValue

type: str = 'TEMPLATE'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Timeout(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: SingleValue

type: str = 'TIMEOUT'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Arguments(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: MultiValue

type: str = 'ARGUMENTS'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.ReturnSetting(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: MultiValue

Represents the deprecated [Return] setting.

This class was named Return prior to Robot Framework 7.0. A forward compatible ReturnSetting alias existed already in Robot Framework 6.1.

type: str = 'RETURN'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.KeywordCall(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'KEYWORD'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property keyword: str
property args: tuple[str, ...]
property assign: tuple[str, ...]
validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.TemplateArguments(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'ARGUMENT'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property args: tuple[str, ...]

Bases: Statement

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: Statement, ABC

Bases: IfElseHeader

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: IfElseHeader

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: IfElseHeader

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: IfElseHeader

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: Statement, ABC

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: NoArgumentHeader

Bases: Statement

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: NoArgumentHeader

class robot.parsing.model.statements.End(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: NoArgumentHeader

type: str = 'END'

Bases: Statement

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

Bases: Statement

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.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}
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property name: str
property value: tuple[str, ...]
property scope: str | None
property separator: str | None
validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.Return(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

Represents the RETURN statement.

This class named ReturnStatement prior to Robot Framework 7.0. The old name still exists as a backwards compatible alias.

type: str = 'RETURN STATEMENT'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property values: tuple[str, ...]
validate(ctx: ValidationContext)[source]
robot.parsing.model.statements.ReturnStatement

alias of Return

class robot.parsing.model.statements.LoopControl(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: NoArgumentHeader, ABC

validate(ctx: ValidationContext)[source]
class robot.parsing.model.statements.Continue(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: LoopControl

type: str = 'CONTINUE'
class robot.parsing.model.statements.Break(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: LoopControl

type: str = 'BREAK'

Bases: Statement

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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.Config(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'CONFIG'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property language: Language | None
class robot.parsing.model.statements.Error(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'ERROR'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

property values: list[str]
property errors: tuple[str, ...]

Errors got from the underlying ``ERROR``token.

Errors can be set also explicitly. When accessing errors, they are returned along with errors got from tokens.

class robot.parsing.model.statements.EmptyLine(tokens: Sequence[Token], errors: Sequence[str] = ())[source]

Bases: Statement

type: str = 'EOL'
classmethod from_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:

  • separator whitespace inserted between each token. Default is four spaces.

  • indent whitespace inserted before first token. Default is four spaces.

  • eol end of line sign. Default is '\n'.

This classmethod should be called from the Statement subclass to create, not from the Statement class itself.

class robot.parsing.model.statements.VariableValidator[source]

Bases: object

validate(statement: Statement)[source]
class robot.parsing.model.statements.AssignmentValidator[source]

Bases: object

validate(statement: Statement)[source]
robot.parsing.model.visitor module
class robot.parsing.model.visitor.VisitorFinder[source]

Bases: object

generic_visit(node: Node) None | Node | list[Node][source]
class robot.parsing.model.visitor.ModelVisitor[source]

Bases: NodeVisitor, VisitorFinder

NodeVisitor that supports matching nodes based on their base classes.

The biggest difference compared to the standard ast.NodeVisitor, is that this class allows creating visit_ClassName methods so that the ClassName is one of the base classes of the node. For example, the following visitor method matches all node classes that extend Statement:

def visit_Statement(self, node):
    ...

Another difference is that visitor methods are cached for performance reasons. This means that dynamically adding visit_Something methods does not work.

visit(node: Node) None[source]

Visit a node.

class robot.parsing.model.visitor.ModelTransformer[source]

Bases: NodeTransformer, VisitorFinder

NodeTransformer that supports matching nodes based on their base classes.

See ModelVisitor for explanation how this is different compared to the standard ast.NodeTransformer.

visit(node: Node) None | Node | list[Node][source]

Visit a node.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4