def _update_ignores_from_file(self, path): # pragma: no cover (integration test) """Parse and append patterns from a standard ignores file.""" for line in common.read_lines(path): pattern = line.strip(" @\\/*\n") if pattern and not pattern.startswith('#'): self._ignores.append('*' + pattern + '*')
def ignores(self): """Yield glob expressions to ignore.""" if self._ignores_cache is None: self._ignores_cache = [] log.debug("reading and caching the ignore patterns...") for filename in self.IGNORES: path = os.path.join(self.path, filename) if os.path.isfile(path): for line in common.read_lines(path): pattern = line.strip(" @\\/*\n") if pattern and not pattern.startswith('#'): self._ignores_cache.append('*' + pattern + '*') yield from self._ignores_cache
def _lines_css(): """Yield lines of CSS to embedded in HTML.""" yield '' for line in common.read_lines(CSS): yield line.rstrip() yield ''