view commitwatcher/store.py @ 12:a0ff003319ec

foo
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 28 Sep 2013 06:40:25 -0700
parents 883c88b13142
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
        """