annotate commitwatcher/event.py @ 39:b04538e7f9f3

stub
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 05 Nov 2013 02:08:21 -0800
parents 798b747b65d6
children 97dfcdeb9a4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 event system for watching commits
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
34
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
5 from abc import abstractmethod
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
6
33
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 class EventHandler(object):
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 """ABC for events"""
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
34
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
10 def match(self, commit):
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
11 """does this event trigger the handler?"""
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
12 return True # abstractmethod
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
13
33
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 class PathEventHandler(EventHandler):
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 """events based on paths"""
34
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
16
463dc92867df commitwatcher/event.py
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
17 def match(self, commit):
37
Jeff Hammel <jhammel@mozilla.com>
parents: 34
diff changeset
18 pass # TODO: move path handling -> commit object