MCPcopy Create free account
hub / github.com/scanny/python-pptx / __iter__

Method __iter__

src/pptx/text/layout.py:237–248  ·  view source on GitHub ↗

Generate a (text, remainder) pair for each possible even-word line break in this line source, where *text* is a str value and remainder is a |_LineSource| value.

(self)

Source from the content-addressed store, hash-verified

235 return self._text == other._text
236
237 def __iter__(self):
238 """
239 Generate a (text, remainder) pair for each possible even-word line
240 break in this line source, where *text* is a str value and remainder
241 is a |_LineSource| value.
242 """
243 words = self._text.split()
244 for idx in range(1, len(words) + 1):
245 line_text = " ".join(words[:idx])
246 remainder_text = " ".join(words[idx:])
247 remainder = _LineSource(remainder_text)
248 yield _Line(line_text, remainder)
249
250 def __nonzero__(self):
251 """

Callers

nothing calls this directly

Calls 3

_LineSourceClass · 0.85
_LineClass · 0.85
splitMethod · 0.80

Tested by

no test coverage detected