view commitwatcher/event.py @ 35:5406eb70f5bd

example
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 01 Nov 2013 09:23:46 -0700
parents 463dc92867df
children 798b747b65d6
line wrap: on
line source

"""
event system for watching commits
"""

from abc import abstractmethod

class EventHandler(object):
    """ABC for events"""

    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