changeset 1155:3d478b05f9b1

add setToGraph Ignore-this: f1e1b6f7604ac19f73cb7622b6aa80fc darcs-hash:866a32aab2e7cffe8781886342602c90b3a87cf1
author drewp <drewp@bigasterisk.com>
date Mon, 16 Apr 2018 22:18:49 -0700
parents 5da3a85b59e4
children ee168d55524a
files lib/patchablegraph.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
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):