Skip to content

Commit c64dcc1

Browse files
committed
Added explicit types to Session interface methods
1 parent 6d2135b commit c64dcc1

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Session.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,25 @@ def finish(self):
99
pass
1010

1111
def execute(self, target: NodePath, action, *arguments):
12-
raise NotImplementedError("TreeView.execute method was not overridden")
12+
raise NotImplementedError("Session.execute method was not overridden")
1313

14-
def get(self, target):
15-
target = NodePath.cast(target)
14+
def get(self, target: NodePath):
1615
return self.execute(target, 'get')
1716

18-
def set(self, target, new_value):
19-
target = NodePath.cast(target)
17+
def set(self, target: NodePath, new_value):
2018
return self.execute(target, 'set', new_value)
2119

22-
def list(self, target):
23-
target = NodePath.cast(target)
20+
def list(self, target: NodePath):
2421
return self.execute(target, 'list')
2522

26-
def exists(self, target):
23+
def exists(self, target: NodePath):
2724
target = NodePath.cast(target)
2825
return self.execute(target.base_path, 'exists', target.base_name)
2926

30-
def create(self, target, value=None):
27+
def create(self, target: NodePath, value=None):
3128
target = NodePath.cast(target)
3229
return self.execute(target.base_path, 'create', target.base_name, value)
3330

34-
def remove(self, target):
31+
def remove(self, target: NodePath):
3532
target = NodePath.cast(target)
3633
return self.execute(target.base_path, 'remove', target.base_name)

todo.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Tree backend:
99
- In-tree links support?
1010
- Easy creation of custom nodes from python classes
1111
+ @action decorator
12-
- Virtual attributes:
12+
- Virtual attributes
1313
- @name
1414
- @path
1515
- @parent
@@ -25,6 +25,7 @@ Functionality:
2525
- Temporary
2626
- select(ed)
2727
- copy/cut/paste
28+
- user session separation
2829
- Transaction
2930
- system settings update
3031
- Network transport

0 commit comments

Comments
 (0)