File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def get_token(auth_ctx):
11
11
return token
12
12
13
13
14
- tenant_name = "mediadev88 .onmicrosoft.com"
14
+ tenant_name = "mediadev8 .onmicrosoft.com"
15
15
client_id , client_secret = os .environ ['Office365_Python_Sdk_ClientCredentials' ].split (';' )
16
16
17
17
client = GraphClient (tenant_name , get_token )
Original file line number Diff line number Diff line change
1
+ import json
1
2
import os
2
3
4
+ from office365 .runtime .client_request import ClientRequest
5
+ from office365 .runtime .utilities .request_options import RequestOptions
3
6
from office365 .sharepoint .caml_query import CamlQuery
4
7
from settings import settings
5
8
from office365 .runtime .auth .authentication_context import AuthenticationContext
@@ -74,14 +77,16 @@ def download_file(context):
74
77
75
78
76
79
if __name__ == '__main__' :
77
- ctx_auth = AuthenticationContext (url = settings ['url' ])
80
+ site_url = 'https://mediadev8.sharepoint.com/sites/Team123'
81
+
82
+ ctx_auth = AuthenticationContext (url = site_url )
78
83
if ctx_auth .acquire_token_for_user (username = settings ['user_credentials' ]['username' ],
79
84
password = settings ['user_credentials' ]['password' ]):
80
85
# if ctx_auth.acquire_token_for_app(client_id=settings['client_credentials']['client_id'],
81
86
# client_secret=settings['client_credentials']['client_secret']):
82
- ctx = ClientContext (settings [ 'url' ] , ctx_auth )
87
+ ctx = ClientContext (site_url , ctx_auth )
83
88
# read_folder_and_files(ctx, "Documents")
84
- read_folder_and_files_alt (ctx , "Documents" )
89
+ # read_folder_and_files_alt(ctx, "Documents")
85
90
# upload_file(ctx)
86
91
# download_file(ctx)
87
92
else :
Original file line number Diff line number Diff line change 4
4
client_credentials = os .environ ['Office365_Python_Sdk_ClientCredentials' ].split (';' )
5
5
6
6
settings = {
7
- 'url' : 'https://mediadev88 .sharepoint.com/' ,
8
- 'tenant' : 'mediadev88 .onmicrosoft.com' ,
7
+ 'url' : 'https://mediadev8 .sharepoint.com/' ,
8
+ 'tenant' : 'mediadev8 .onmicrosoft.com' ,
9
9
'redirect_url' : 'https://github.com/vgrem/Office365-REST-Python-Client/' ,
10
10
'user_credentials' : {
11
11
'username' : user_credentials [0 ],
12
12
'password' : user_credentials [1 ]
13
13
},
14
14
'client_credentials' : {
15
- 'client_id' : 'd4b2d51e-2d8e-4f08-8bce-961a7a435130' ,
15
+ 'client_id' : client_credentials [ 0 ] ,
16
16
'client_secret' : client_credentials [1 ],
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class WebExtensions(object):
40
40
@classmethod
41
41
def get_all_webs (cls , parent_web , result = None ):
42
42
if result is None :
43
- result = []
43
+ result = [parent_web ]
44
44
ctx = parent_web .context
45
45
webs = parent_web .webs
46
46
ctx .load (webs )
You can’t perform that action at this time.
0 commit comments