diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-10-20 19:34:43 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-10-20 19:34:43 +0200 |
| commit | c97f56e93d3bb3a7b838093b0ecb4fec9c9e0d34 (patch) | |
| tree | 0673e013ab30562bbfb31bfde71bc73b3079cb08 /src-py/model/graph.py | |
| parent | 7095cc48865cc46ad20f28de79ba62d80e8d2153 (diff) | |
misc
Diffstat (limited to 'src-py/model/graph.py')
| -rw-r--r-- | src-py/model/graph.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src-py/model/graph.py b/src-py/model/graph.py index 52ed39b1..8942285d 100644 --- a/src-py/model/graph.py +++ b/src-py/model/graph.py @@ -31,7 +31,7 @@ class Attr_Diff(dict): n_attr_diff = self.init_node_attr_diff(n_id) n_attr_diff['attr_remove'].append(attr_name) -class Topo_Diff(): +class Topo_Diff(object): """ Represents a change to the graph topology """ @@ -45,18 +45,15 @@ class Topo_Diff(): self.node_set_add = node_set_add self.link_set_add = link_set_add - @property - def link_set_rm(self): - return self.link_set_rm - - @property - def node_set_rm(self): - return self.node_set_rm - - @property - def link_set_add(self): - return self.link_set_add + def check_validity(self, topo_diff_dict): + """ + Topo_Diff may represent invalid operations, eg. adding a link while + removing it's end-point - this stub should check for that + """ + pass - @property - def node_set_add(self): - return self.node_set_add + @staticmethod + def from_dict(topo_diff_dict): + ret = Topo_Diff() + ret.__dict__ = topo_diff_dict + return ret |
