adding a json object for URLs
This commit is contained in:
@@ -27,17 +27,19 @@ def create_folder_structure_json(path):
|
||||
return result
|
||||
|
||||
for entry in os.listdir(path):
|
||||
|
||||
entry_path = os.path.join(path, entry)
|
||||
|
||||
base_url = entry_path[6:]
|
||||
if os.path.isdir(entry_path):
|
||||
result['children'].append(
|
||||
create_folder_structure_json(entry_path)
|
||||
)
|
||||
|
||||
|
||||
elif entry.lower().endswith('.html'):
|
||||
file_entry = {
|
||||
'name': entry,
|
||||
'type': 'file',
|
||||
'url': base_url,
|
||||
'content': None
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user