robot.parsing.parser package¶
Submodules¶
robot.parsing.parser.blockparsers module¶
-
class
robot.parsing.parser.blockparsers.
Parser
(model)[source]¶ Bases:
object
Base class for parsers.
robot.parsing.parser.fileparser module¶
-
class
robot.parsing.parser.fileparser.
SettingSectionParser
(header)[source]¶ Bases:
robot.parsing.parser.fileparser.SectionParser
-
handles
(statement)¶
-
parse
(statement)¶
-
-
class
robot.parsing.parser.fileparser.
VariableSectionParser
(header)[source]¶ Bases:
robot.parsing.parser.fileparser.SectionParser
-
handles
(statement)¶
-
parse
(statement)¶
-
-
class
robot.parsing.parser.fileparser.
CommentSectionParser
(header)[source]¶ Bases:
robot.parsing.parser.fileparser.SectionParser
-
handles
(statement)¶
-
parse
(statement)¶
-
-
class
robot.parsing.parser.fileparser.
ImplicitCommentSectionParser
(statement)[source]¶ Bases:
robot.parsing.parser.fileparser.SectionParser
-
handles
(statement)¶
-
parse
(statement)¶
-
-
class
robot.parsing.parser.fileparser.
TestCaseSectionParser
(header)[source]¶ Bases:
robot.parsing.parser.fileparser.SectionParser
-
handles
(statement)¶
-
robot.parsing.parser.parser module¶
-
robot.parsing.parser.parser.
get_model
(source, data_only=False, curdir=None)[source]¶ Parses the given source to a model represented as an AST.
How to use the model is explained more thoroughly in the general documentation of the
robot.parsing
module.Parameters: - source – The source where to read the data. Can be a path to
a source file as a string or as
pathlib.Path
object, an already opened file object, or Unicode text containing the date directly. Source files must be UTF-8 encoded. - data_only – When
False
(default), returns all tokens. When set toTrue
, omits separators, comments, continuation markers, and other non-data tokens. Model like this cannot be saved back to file system. - curdir – Directory where the source file exists. This path is used
to set the value of the built-in
${CURDIR}
variable during parsing. When not given, the variable is left as-is. Should only be given only if the model will be executed afterwards. If the model is saved back to disk, resolving${CURDIR}
is typically not a good idea.
Use
get_resource_model()
orget_init_model()
when parsing resource or suite initialization files, respectively.- source – The source where to read the data. Can be a path to
a source file as a string or as
-
robot.parsing.parser.parser.
get_resource_model
(source, data_only=False, curdir=None)[source]¶ Parses the given source to a resource file model.
Otherwise same as
get_model()
but the source is considered to be a resource file. This affects, for example, what settings are valid.
-
robot.parsing.parser.parser.
get_init_model
(source, data_only=False, curdir=None)[source]¶ Parses the given source to a init file model.
Otherwise same as
get_model()
but the source is considered to be a suite initialization file. This affects, for example, what settings are valid.