Mercurial > code > home > repos > homeauto
comparison 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 |
comparison
equal
deleted
inserted
replaced
349:88bd46f4e28c | 350:a380561fd8a8 |
---|---|
105 def removeObserver(self, onPatch): | 105 def removeObserver(self, onPatch): |
106 try: | 106 try: |
107 self._observers.remove(onPatch) | 107 self._observers.remove(onPatch) |
108 except ValueError: | 108 except ValueError: |
109 pass | 109 pass |
110 | |
111 def setToGraph(self, newGraph): | |
112 self.patch(Patch.fromDiff(self._graph, newGraph)) | |
110 | 113 |
111 | 114 |
112 class CycloneGraphHandler(PrettyErrorHandler, cyclone.web.RequestHandler): | 115 class CycloneGraphHandler(PrettyErrorHandler, cyclone.web.RequestHandler): |
113 def initialize(self, masterGraph): | 116 def initialize(self, masterGraph): |
114 self.masterGraph = masterGraph | 117 self.masterGraph = masterGraph |