33
|
1 """
|
|
2 event system for watching commits
|
|
3 """
|
|
4
|
40
|
5 __all__ = ['EventHandler', 'PathEventHandler']
|
34
|
6
|
33
|
7 class EventHandler(object):
|
|
8 """ABC for events"""
|
|
9
|
40
|
10 def __init__(self, *notifiers):
|
|
11 self.notifiers = list(notifiers)
|
|
12
|
34
|
13 def match(self, commit):
|
|
14 """does this event trigger the handler?"""
|
|
15 return True # abstractmethod
|
|
16
|
33
|
17 class PathEventHandler(EventHandler):
|
|
18 """events based on paths"""
|
34
|
19
|
|
20 def match(self, commit):
|
37
|
21 pass # TODO: move path handling -> commit object
|