File Info - Need an attribute that displays folder tree
I found path_collection that has a crud list of the folders in the tree but I was looking for the normal folder tree ex. /folder1/folder2/folder3/file.txt
The commented lines below shared_link, vanity_url, and vanity_name are not pulling data but it would seem they might be what I am looking for. Is my python syntax correct or is there another attribute I am missing?
Thanks
if item.type.capitalize() == "File":
# print ("Found File = " + item.id + " file name = " + item.name)
file_id = item.id
file_info = client.file(file_id).get()
print('Filename = {0} description = {1} size = {2} bytes. version id = {3} sha1 = {4} version sha1 = {5} created date = {6} modified date = {7} purge date = {8}, url = {9} modified by = {10} created by = {11} owned by = {12}'.format(file_info.name, file_info.description, file_info.size, file_info.file_version.id, file_info.sha1, file_info.file_version.sha1, file_info.created_at, file_info.modified_at, file_info.purged_at, file_info.shared_link, file_info.modified_by.name, file_info.created_by.name, file_info.owned_by.name))
print("parent = " + file_info.parent.name)
print("path_collection = " + str(file_info.path_collection))
# print("shared_link = " + str(file_info.shared_link))
# print("vanity_name = " + str(file_info.shared_link.vanity_name))
# print("vanity_url = " + str(file_info.shared_link.vanity_url))
Please sign in to leave a comment.
Comments
0 comments