some more work in structure

This commit is contained in:
chrys
2019-01-22 21:29:55 +01:00
parent 39684dea75
commit 8285ccaaed
8 changed files with 191 additions and 1 deletions

View File

@ -5,6 +5,7 @@
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
import os
class vmenuManager():
@ -62,4 +63,26 @@ class vmenuManager():
return
self.currIndex -= 1
if self.currIndex < 0:
self.currIndex = len(self.menuDict) - 1
self.currIndex = len(self.menuDict) - 1
def fs_tree_to_dict(self, path_):
for root, dirs, files in os.walk(path_):
tree = {d: fs_tree_to_dict(os.path.join(root, d)) for d in dirs}
tree.update({f: root + f for f in files})
return tree # note we discontinue iteration trough os.walk
''''
import os
level = [0]
def fs_tree_to_dict( path_):
file_token = ''
for root, dirs, files in os.walk(path_):
tree = {d: fs_tree_to_dict(os.path.join(root, d)) for d in dirs}
print(files, root, dirs)
tree.update({f: root + f for f in files})
return tree # note we discontinue iteration trough os.walk
v = fs_tree_to_dict( '/home/chrys/Projekte/fenrir/src/fenrirscreenreader/commands/vmenu')
''''