vfind command

This commit is contained in:
Amber
2024-01-29 14:07:09 +01:00
parent bd2eef0cf7
commit 60ccd874df
9 changed files with 50 additions and 7 deletions

View File

@ -1,5 +1,5 @@
from colors import RED, YELLOW, GREEN, CYAN , BLUE, PURPLE
from tree import NerdTree
from src.colors import RED, YELLOW, GREEN, CYAN , BLUE, PURPLE
from src.tree import NerdTree
class NerdTreeFind(NerdTree):
'''
@ -8,11 +8,12 @@ class NerdTreeFind(NerdTree):
@param opts dict: the opts for the tree representation
'''
def __init__(self, startpath, opts={}):
def __init__(self, startpath, opts={}, find_opts={}):
self.item_name = ''
self.results = []
## computed tree for find
self.json_tree_find = {}
self.find_opts = find_opts
NerdTree.__init__(self, startpath, opts=opts)
def find_node_recursively(self, node):
@ -63,7 +64,7 @@ class NerdTreeFind(NerdTree):
'''
results = self.find_node()
dont_show_children_nodes = self.find_opts['dont_show_children_nodes'] if self.find_opts.get('dont_show_children_nodes') else False
dont_show_children_nodes = self.find_opts['dont_show_children_nodes'] if self.find_opts.get('dont_show_children_nodes') is not None else False
if not results:
return {}