Support batch command for existing APIs
This commit is contained in:
@@ -43,6 +43,21 @@ def set_vertex_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
return SqlChangeSet(redo_sql, undo_sql, redo_cs, undo_cs)
|
||||
|
||||
|
||||
def add_vertex_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
result = set_vertex_cache(name, cs)
|
||||
result.redo_cs |= g_add_prefix
|
||||
result.undo_cs |= g_delete_prefix
|
||||
return result
|
||||
|
||||
|
||||
def delete_vertex_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
cs.operations[0]['coords'] = []
|
||||
result = set_vertex_cache(name, cs)
|
||||
result.redo_cs |= g_delete_prefix
|
||||
result.undo_cs |= g_add_prefix
|
||||
return result
|
||||
|
||||
|
||||
def set_vertex(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
result = set_vertex_cache(name, cs)
|
||||
result.redo_cs |= g_update_prefix
|
||||
|
||||
Reference in New Issue
Block a user