Exemplo n.º 1
0
 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 + '*')
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
def _lines_css():
    """Yield lines of CSS to embedded in HTML."""
    yield ''
    for line in common.read_lines(CSS):
        yield line.rstrip()
    yield ''