summaryrefslogtreecommitdiff
path: root/src-py/db_controller.py
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-10-15 18:38:53 +0200
committerLV-426 <lv-426@taproot.org.il>2014-10-15 18:38:53 +0200
commitcd4c8fc54cdd6d24ef6385a89afdec1c9d65e9cb (patch)
treee84c16d4e3c88ae2185c72df9c74041a54f740fb /src-py/db_controller.py
parent93873bd93ccc8463eaa3931e1efe7d30d1007e0b (diff)
DBO_topo_diff_commit & test
Diffstat (limited to 'src-py/db_controller.py')
-rw-r--r--src-py/db_controller.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src-py/db_controller.py b/src-py/db_controller.py
index 9a6151ec..dcb70c10 100644
--- a/src-py/db_controller.py
+++ b/src-py/db_controller.py
@@ -101,6 +101,28 @@ class DB_composed_op(DB_op):
return object.__getattribute__(self, attr)
+class DBO_topo_diff_commit(DB_composed_op):
+ """
+ commit a
+ """
+ def __init__(self, topo_diff):
+ super(DBO_topo_diff_commit, self).__init__()
+
+ # TODO rm link set
+ # TODO rm node set
+ assert not topo_diff.node_set_rm, 'unsupported'
+ assert not topo_diff.link_set_rm, 'unsupported'
+
+ n_add_map = db_util.meta_attr_list_to_meta_attr_map(topo_diff.node_set_add)
+ l_add_map = db_util.meta_attr_list_to_meta_attr_map(topo_diff.link_set_add)
+
+ op_n_add = DBO_add_node_set(n_add_map)
+ op_l_add = DBO_add_link_set(l_add_map)
+
+ # [!] order critical
+ self.add_sub_op(op_n_add)
+ self.add_sub_op(op_l_add)
+
pass
class DBO_add_node_set(DB_op):