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