|
1 | 1 | from contextshell.Node import Node
|
2 | 2 | from contextshell.NodePath import NodePath
|
3 |
| -from contextshell.TreeRoot import TreeRoot, ActionArgsPack, OrderedDict |
| 3 | +from contextshell.ActionEndpoint import ActionEndpoint |
| 4 | +from contextshell.ActionExecutor import ActionArgsPack, OrderedDict |
4 | 5 | from contextshell.Action import Action
|
5 | 6 | from contextshell.CallableAction import action_from_function
|
6 | 7 | from typing import List, Optional
|
7 | 8 |
|
8 | 9 |
|
9 | 10 | # CHECK: how to implement TemporaryTreeRoot (based on NodeTreeRoot)
|
10 |
| -class NodeTreeRoot(TreeRoot): |
| 11 | +class NodeTreeRoot(ActionEndpoint): |
11 | 12 | """Frontend to the (passive) node-based data storage"""
|
12 | 13 | def __init__(self):
|
13 | 14 | self.root = self.create_node(None)
|
@@ -118,15 +119,6 @@ def find_type(self, target: NodePath, type_name: NodePath): # TODO: add type-hi
|
118 | 119 | return None
|
119 | 120 | return type_node.get()
|
120 | 121 |
|
121 |
| - def execute(self, target: NodePath, action_name: NodePath, args: ActionArgsPack = None): |
122 |
| - #print("Execute: {}: {} {}".format(target, action, args)) |
123 |
| - if not args: |
124 |
| - args = OrderedDict() |
125 |
| - action_impl = self.find_action(target, action_name) |
126 |
| - if action_impl is None: |
127 |
| - raise NameError("Could not find action named '{}'".format(action_name)) |
128 |
| - return action_impl.invoke(target, action_name, args) |
129 |
| - |
130 | 122 | def create_node(self, value):
|
131 | 123 | return Node(value)
|
132 | 124 |
|
|
0 commit comments