diff lib/patchablegraph.py @ 350:a380561fd8a8

add setToGraph Ignore-this: f1e1b6f7604ac19f73cb7622b6aa80fc
author drewp@bigasterisk.com
date Mon, 16 Apr 2018 22:18:49 -0700
parents a94f2a522d41
children fcd2c026f51e
line wrap: on
line diff
--- a/lib/patchablegraph.py	Mon Apr 16 22:16:15 2018 -0700
+++ b/lib/patchablegraph.py	Mon Apr 16 22:18:49 2018 -0700
@@ -107,6 +107,9 @@
             self._observers.remove(onPatch)
         except ValueError:
             pass
+
+    def setToGraph(self, newGraph):
+        self.patch(Patch.fromDiff(self._graph, newGraph))
         
 
 class CycloneGraphHandler(PrettyErrorHandler, cyclone.web.RequestHandler):