Version

Quick search

Table Of Contents

Parser

Class used for the parsing of .kv files into rules.

class kivy.lang.parser.Parser(**kwargs)[source]

Bases: builtins.object

Create a Parser object to parse a Kivy language file or Kivy content.

parse(content)[source]

Parse the contents of a Parser file and return a list of root objects.

parse_level(level, lines, spaces=0)[source]

Parse the current level (level * spaces) indentation.

strip_comments(lines)[source]

Remove all comments from all lines in-place. Comments need to be on a single line and not at the end of a line. i.e. a comment line’s first non-whitespace character must be a #.

exception kivy.lang.parser.ParserException(context, line, message, cause=None)[source]

Bases: Exception

Exception raised when something wrong happened in a kv file.