diff foodtruck/scm/base.py @ 598:3cec8634209a

admin: Ability to configure SCM stuff per site.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 22 Jan 2016 11:01:00 -0800
parents d4a01a023998
children a77b4656c602
line wrap: on
line diff
--- a/foodtruck/scm/base.py	Wed Jan 20 21:39:18 2016 -0800
+++ b/foodtruck/scm/base.py	Fri Jan 22 11:01:00 2016 -0800
@@ -7,12 +7,17 @@
 
 
 class SourceControl(object):
-    def __init__(self, root_dir):
+    def __init__(self, root_dir, cfg):
         self.root_dir = root_dir
+        self.config = cfg
 
     def getStatus(self):
         raise NotImplementedError()
 
-    def commit(self, paths, author, message):
+    def commit(self, paths, message, *, author=None):
+        author = author or self.config.get('author')
+        self._doCommit(paths, message, author)
+
+    def _doCommit(self, paths, message, author):
         raise NotImplementedError()