Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Fix for autocomplete #298

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kuksa_viss_client/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def get_childtree(self, pathText):
childVssTree = childVssTree[path]
elif 'children' in childVssTree and path in childVssTree['children']:
childVssTree = childVssTree['children'][path]
else:
# This else-branch is reached when one of the path components is invalid
# In that case stop parsing further and return an empty tree
# Autocompletion can't help here.
childVssTree={}
break

if 'children' in childVssTree:
childVssTree = childVssTree['children']
Expand Down Expand Up @@ -88,7 +94,6 @@ def path_completer(self, text, line, begidx, endidx):
if 'children' in child:
self.pathCompletionItems.append(CompletionItem(prefix + key+seperator, "Children of branch "+prefix+key))


return basic_complete(text, line, begidx, endidx, self.pathCompletionItems)

def subscribeCallback(self, path, attr, resp):
Expand Down