Mercurial > hg > WSGraph
diff wsgraph/model.py @ 25:d1a8c1436ded
notes to self
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 12 Dec 2012 18:39:47 -0800 |
parents | 24d57daaca21 |
children | 4bed1424bb3f |
line wrap: on
line diff
--- a/wsgraph/model.py Wed Dec 12 18:27:34 2012 -0800 +++ b/wsgraph/model.py Wed Dec 12 18:39:47 2012 -0800 @@ -2,7 +2,7 @@ from copy import deepcopy from utils import isiterable -class GraphModel(object): +class Graph(object): @abstractmethod def node(self, name, **values): @@ -70,7 +70,7 @@ return tuple(key) in self.edges() -class MemoryCache(GraphModel): +class MemoryCache(Graph): """volatile in-memory representation of a graph""" def __init__(self): @@ -100,3 +100,13 @@ def edges(self): return self._edges.keys() + +class FileCache(MemoryCache): + """on-disk JSON file cache""" + + def __init__(self, filename): + self.filename = filename + raise NotImplementedError + +# TODO: CLI entry point to convert from one model to another +# def main()