Shrink down the exposed methods.

The catalog really only cares right now about getting or
creating a logbook for a given job, lets keep the api simple
to just do that until further notice.
This commit is contained in:
Joshua Harlow
2013-05-13 18:40:34 -07:00
parent 153b5a460f
commit bd84e626b3

View File

@@ -24,19 +24,14 @@ class Catalog(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def fetch(self, job):
"""Fetches a logbook for a job."""
raise NotImplementedError()
@abc.abstractmethod
def __contains__(self, job):
"""Checks if the given catalog has a logbook for a job."""
raise NotImplementedError()
@abc.abstractmethod
def create(self, job):
"""Creates a new logbook for a job."""
def create_or_fetch(self, job):
"""Creates a new logbook for a job or gives back an old one."""
raise NotImplementedError()
@abc.abstractmethod