view commitwatcher/store.py @ 6:883c88b13142

commitwatcher/agent.py commitwatcher/store.py mozbasewatcher.py
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 27 Sep 2013 13:03:40 -0700
parents d85093ba9f45
children a8e21cfda5fe
line wrap: on
line source

from abc import abstractmethod

__all__ = ['CommitStore', 'MemoryStore']

class CommitStore(object):
    """
    ABC for commits
    """

    @abstractmethod
    def add(self, commit):
        """adds a commit to the store"""

    @abstractmethod
    def paths(self, *commits):
        """return all paths touched for a given commit"""


class MemoryStore(CommitStore):
    """store in volatile memory"""
    # volatile!

    def add(self, commit):
        raise NotImplementedError()

    def paths(self, *commits):
        """
        return touched by commits
        """