pull/29/head
deadc0de6 2 years ago
parent 7775a941a7
commit 58e533f69e

@ -159,7 +159,8 @@ class Noder:
############################################################### ###############################################################
# public helpers # public helpers
############################################################### ###############################################################
def format_storage_attr(self, attr): @staticmethod
def format_storage_attr(attr):
"""format the storage attr for saving""" """format the storage attr for saving"""
if not attr: if not attr:
return '' return ''
@ -232,7 +233,8 @@ class Noder:
parent=parent, size=0, md5=None, parent=parent, size=0, md5=None,
archive=archive) archive=archive)
def _new_generic_node(self, name, nodetype, relpath, parent, @staticmethod
def _new_generic_node(name, nodetype, relpath, parent,
size=None, md5=None, maccess=None): size=None, md5=None, maccess=None):
"""generic node creation""" """generic node creation"""
return anytree.AnyNode(name=name, type=nodetype, relpath=relpath, return anytree.AnyNode(name=name, type=nodetype, relpath=relpath,
@ -474,7 +476,8 @@ class Noder:
for _, _, item in rend: for _, _, item in rend:
self._node_to_csv(item, raw=raw) self._node_to_csv(item, raw=raw)
def _fzf_prompt(self, strings): @staticmethod
def _fzf_prompt(strings):
# prompt with fzf # prompt with fzf
fzf = FzfPrompt() fzf = FzfPrompt()
selected = fzf.prompt(strings) selected = fzf.prompt(strings)
@ -508,7 +511,8 @@ class Noder:
rend = nodes[path] rend = nodes[path]
self.print_tree(rend, fmt=subfmt) self.print_tree(rend, fmt=subfmt)
def to_dot(self, node, path='tree.dot'): @staticmethod
def to_dot(node, path='tree.dot'):
"""export to dot for graphing""" """export to dot for graphing"""
anytree.exporter.DotExporter(node).to_dotfile(path) anytree.exporter.DotExporter(node).to_dotfile(path)
Logger.info(f'dot file created under \"{path}\"') Logger.info(f'dot file created under \"{path}\"')

Loading…
Cancel
Save