MCPcopy Create free account
hub / github.com/webpy/webpy / read_suite

Method read_suite

web/template.py:170–181  ·  view source on GitHub ↗

r"""Reads section by section till end of text. >>> read_suite = Parser().read_suite >>> read_suite('hello $name\nfoo\n') [ , ]

(self, text)

Source from the content-addressed store, hash-verified

168 return VarNode(name, value), text
169
170 def read_suite(self, text):
171 r"""Reads section by section till end of text.
172
173 >>> read_suite = Parser().read_suite
174 >>> read_suite('hello $name\nfoo\n')
175 [<line: [t'hello ', $name, t'\n']>, <line: [t'foo\n']>]
176 """
177 sections = []
178 while text:
179 section, text = self.read_section(text)
180 sections.append(section)
181 return SuiteNode(sections)
182
183 def readline(self, text):
184 r"""Reads one line from the text. Newline is suppressed if the line ends with \.

Callers 2

parseMethod · 0.95
__init__Method · 0.80

Calls 3

read_sectionMethod · 0.95
SuiteNodeClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected