def recursive_fetch()

in ees_network_drive/files.py [0:0]


    def recursive_fetch(self, smb_connection, service_name, path, store):
        """This method is used to recursively fetch folder paths from Network Drives.
            :param smb_connection: SMB connection object
            :param service_name: name of the drive
            :param path: Path of the Network Drives
            :param store: temporary storage for fetched ids from Drive
            :returns: list of all the folder paths in network drives
        """
        try:
            file_list = smb_connection.listPath(service_name, rf'{path}', search=16)
        except Exception as exception:
            self.logger.exception(f"Unknown error while fetching files {exception}")
            return store
        for file in file_list:
            if file.filename not in ['.', '..']:
                file_name = file.filename
                self.recursive_fetch(smb_connection, service_name, os.path.join(path, file_name), store)
        store.append(path)
        return store