Browse Source

Move iteration of sub-content errors into the ContentList.iter_errors() iterator

pull/176/head
Louis 9 years ago
parent
commit
49080bc7f1
  1. 4
      patacrep/build.py
  2. 4
      patacrep/content/__init__.py

4
patacrep/build.py

@ -131,10 +131,6 @@ class Songbook:
yield from self._errors yield from self._errors
contentlist = self._config.get('content', content.ContentList()) contentlist = self._config.get('content', content.ContentList())
yield from contentlist.iter_errors() yield from contentlist.iter_errors()
for item in contentlist:
if not hasattr(item, "iter_errors"):
continue
yield from item.iter_errors()
def requires_lilypond(self): def requires_lilypond(self):
"""Tell if lilypond is part of the bookoptions""" """Tell if lilypond is part of the bookoptions"""

4
patacrep/content/__init__.py

@ -185,6 +185,10 @@ class ContentList:
def iter_errors(self): def iter_errors(self):
"""Iterate over errors.""" """Iterate over errors."""
yield from self._errors yield from self._errors
for item in self:
if not hasattr(item, "iter_errors"):
continue
yield from item.iter_errors()
class EmptyContentList(ContentList): class EmptyContentList(ContentList):
"""Empty content list: contain only errors.""" """Empty content list: contain only errors."""

Loading…
Cancel
Save