From 57df3525366ad90d7ff96f0066e3be957031b736 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 21 Feb 2013 16:55:38 +0100 Subject: [PATCH] Give pushtrigger the configuration object So that they can read some configuration variables --- pggit.py | 4 ++-- triggers.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pggit.py b/pggit.py index 4e6d45c..1ac9251 100755 --- a/pggit.py +++ b/pggit.py @@ -58,9 +58,9 @@ class PgGit(object): try: mod = __import__(modname) c = getattr(mod, classname) - self.pushtrigger = c() + self.pushtrigger = c(self.cfg) except Exception, e: - raise InternalException("Failed to load push trigger class") + raise InternalException("Failed to load push trigger class: %s" % e) else: self.pushtrigger = None diff --git a/triggers.py b/triggers.py index 5b7b6b5..97a347e 100644 --- a/triggers.py +++ b/triggers.py @@ -1,3 +1,6 @@ class test(object): + def __init__(self, cfg): + pass + def pushtrigger(self, reponame, username): print "Firing push trigger for repository '%s', due to push by %s" % (reponame, username) -- 2.39.5