Mercurial > piecrust2
view piecrust/admin/scm/base.py @ 852:4850f8c21b6e
core: Start of the big refactor for PieCrust 3.0.
* Everything is a `ContentSource`, including assets directories.
* Most content sources are subclasses of the base file-system source.
* A source is processed by a "pipeline", and there are 2 built-in pipelines,
one for assets and one for pages. The asset pipeline is vaguely functional,
but the page pipeline is completely broken right now.
* Rewrite the baking process as just running appropriate pipelines on each
content item. This should allow for better parallelization.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 17 May 2017 00:11:48 -0700 |
parents | 5e91bc0e3b4d |
children |
line wrap: on
line source
class RepoStatus(object): def __init__(self): self.new_files = [] self.edited_files = [] class SourceControl(object): def __init__(self, root_dir, cfg): self.root_dir = root_dir self.config = cfg def getStatus(self): raise NotImplementedError() def commit(self, paths, message, *, author=None): if not message: raise ValueError("No message specified for committing changes.") author = author or self.config.get('author') self._doCommit(paths, message, author) def _doCommit(self, paths, message, author): raise NotImplementedError() def _s(strs): """ Convert a byte array to string using UTF8 encoding. """ if strs is None: return None assert isinstance(strs, bytes) return strs.decode('utf8')