# HG changeset patch # User Jeff Hammel # Date 1355366387 28800 # Node ID d1a8c1436ded1797802fc182985e4f72b73f2fe7 # Parent e46b4466abacc6d668383c79618344dc911f591d notes to self diff -r e46b4466abac -r d1a8c1436ded wsgraph/client.py --- a/wsgraph/client.py Wed Dec 12 18:27:34 2012 -0800 +++ b/wsgraph/client.py Wed Dec 12 18:39:47 2012 -0800 @@ -1,6 +1,6 @@ #!/usr/bin/env python - +from .model import Graph class WSGraphClient(): """REST client for WSGraph""" diff -r e46b4466abac -r d1a8c1436ded wsgraph/model.py --- 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()