Skip to content

Commit 41fc95a

Browse files
committed
Add the root folder node under the root zip node
|- root-folder.zip |- root-folder/ |- folder_1/ |- file_1.a |- file_2.b
1 parent 38e2e1f commit 41fc95a

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

mfr/extensions/zip/render.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,9 @@ def sorted_obj_list_to_tree(self, sorted_obj_list: list) -> List[dict]:
5454
path_from_root = obj.filename
5555
print(path_from_root)
5656
path_segments = [segment for segment in path_from_root.split('/') if segment]
57-
# Ignore the root tree node
58-
if len(path_segments) == 1:
59-
continue
6057
# Find the parent node of the current object, always start from the root node
6158
parent = tree_root
6259
for index, segment in enumerate(path_segments):
63-
# the first segment is the tree node, skip
64-
if index == 0:
65-
continue
6660
# last segment is the current object, parents must have been found, end loop
6761
if index == len(path_segments) - 1:
6862
break

0 commit comments

Comments
 (0)