mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add improved file functions.
Add sort in filenames
This commit is contained in:
parent
71d3e03875
commit
2afecf8fab
@ -649,9 +649,9 @@ class Helpers:
|
||||
|
||||
@staticmethod
|
||||
def generate_tree(folder, output=""):
|
||||
for raw_filename in os.listdir(folder):
|
||||
filename = html.escape(raw_filename)
|
||||
rel = os.path.join(folder, raw_filename)
|
||||
for file in sorted(os.scandir(folder), key=lambda e: e.name):
|
||||
filename = html.escape(file.name)
|
||||
rel = os.path.join(folder, filename)
|
||||
if os.path.isdir(rel):
|
||||
output += \
|
||||
"""<li class="tree-item" data-path="{}">
|
||||
|
Loading…
Reference in New Issue
Block a user