changeset 25:d1a8c1436ded

notes to self
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 12 Dec 2012 18:39:47 -0800
parents e46b4466abac
children 60d7e38a20cd
files wsgraph/client.py wsgraph/model.py
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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"""
--- 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()