-
-
Notifications
You must be signed in to change notification settings - Fork 371
Expand file tree
/
Copy pathlist.py
More file actions
19 lines (16 loc) · 543 Bytes
/
list.py
File metadata and controls
19 lines (16 loc) · 543 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
Retrieves versions of the file
"""
from office365.sharepoint.client_context import ClientContext
from tests import test_client_credentials, test_team_site_url
ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
file_url = "SitePages/Home.aspx"
file_with_versions = (
ctx.web.get_file_by_server_relative_path(file_url)
.expand(["Versions"])
.get()
.execute_query()
)
for version in file_with_versions.versions:
# print(version.properties.get("Created"))
print(version.version_label)