minor renaming
This commit is contained in:
@@ -86,27 +86,27 @@ class DirectoryAPI(Resource):
|
|||||||
if not path:
|
if not path:
|
||||||
path = ''
|
path = ''
|
||||||
|
|
||||||
absolute_path_root = project.repository_path
|
path_root_abs = project.repository_path
|
||||||
parent_path = ''
|
parent_path = ''
|
||||||
|
|
||||||
if path != '':
|
if path != '':
|
||||||
absolute_path_root = os.path.join(absolute_path_root, path)
|
path_root_abs = os.path.join(path_root_abs, path)
|
||||||
parent_path = os.pardir
|
parent_path = os.pardir
|
||||||
|
|
||||||
|
|
||||||
if not os.path.isdir(absolute_path_root):
|
if not os.path.isdir(path_root_abs):
|
||||||
return jsonify(message="Path is not a directory %r" % absolute_path_root)
|
return jsonify(message="Path is not a directory %r" % path_root_abs)
|
||||||
|
|
||||||
items_list = []
|
items_list = []
|
||||||
|
|
||||||
for f in os.listdir(absolute_path_root):
|
for f in os.listdir(path_root_abs):
|
||||||
relative_path = os.path.join(path, f)
|
f_rel = os.path.join(path, f)
|
||||||
absolute_path = os.path.join(absolute_path_root, f)
|
f_abs = os.path.join(path_root_abs, f)
|
||||||
|
|
||||||
if os.path.isdir(absolute_path):
|
if os.path.isdir(f_abs):
|
||||||
items_list.append((f, relative_path, "dir"))
|
items_list.append((f, f_rel, "dir"))
|
||||||
else:
|
else:
|
||||||
items_list.append((f, relative_path, "file"))
|
items_list.append((f, f_rel, "file"))
|
||||||
|
|
||||||
project_files = {
|
project_files = {
|
||||||
"parent_path": parent_path,
|
"parent_path": parent_path,
|
||||||
|
Reference in New Issue
Block a user