Mercurial > hg > CommitWatcher
view commitwatcher/event.py @ 44:4f8fe143b977
whitespace
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 06 Nov 2013 23:08:20 -0800 |
parents | 97dfcdeb9a4e |
children |
line wrap: on
line source
""" event system for watching commits """ __all__ = ['EventHandler', 'PathEventHandler'] class EventHandler(object): """ABC for events""" def __init__(self, *notifiers): self.notifiers = list(notifiers) def match(self, commit): """does this event trigger the handler?""" return True # abstractmethod class PathEventHandler(EventHandler): """events based on paths""" def match(self, commit): pass # TODO: move path handling -> commit object