MCPcopy Index your code
hub / github.com/O365/python-o365 / upload_folder

Method upload_folder

examples/onedrive_example.py:93–107  ·  view source on GitHub ↗
(self, folder_name, destination=None)

Source from the content-addressed store, hash-verified

91 '''
92
93 def upload_folder(self, folder_name, destination=None):
94 print()
95 print('Uploading folder ' + folder_name)
96 if destination is None:
97 destination = folder_name
98 destination_item = self.get_child_folder(self.root_folder, destination)
99
100 for file in os.listdir(folder_name):
101 path = os.path.join(folder_name, file)
102 if os.path.isfile(path):
103 self.upload_file(path, destination)
104 else:
105 folder = self.get_folder_from_path(destination)
106 child_destination = self.get_child_folder(folder, file)
107 self.upload_folder(path, os.path.join(destination, file))
108
109 '''
110 Download entire folder named $folder_name from cloud to local folder named $to_folder.

Callers 1

mainFunction · 0.95

Calls 3

get_child_folderMethod · 0.95
upload_fileMethod · 0.95
get_folder_from_pathMethod · 0.95

Tested by

no test coverage detected