labpack/storage/dropbox.py
def remove(self):
        
        ''' 
            a method to remove all records in the collection

        NOTE:   this method removes all the files in the collection, but the
                collection folder itself created by oauth2 cannot be removed.
                only the user can remove the app folder
                
        :return: string with confirmation of deletion
        '''

        title = '%s.remove' % self.__class__.__name__
    
    # get contents in root
        try:
            response = self.dropbox.files_list_folder(path='')
        except:
            raise DropboxConnectionError(title)

    # populate delete list
        delete_list = []
        for file in response.entries:
            delete_list.append(self.objects.DeleteArg(path=file.path_display))

    # continue retrieval if folder is large
        if response.has_more:
            try:
                while response.has_more:
                    response = self.dropbox.files_list_folder_continue(response.cursor)
                    for file in response.entries:
                        delete_list.append(self.objects.DeleteArg(path=file.path_display))
            except:
                raise DropboxConnectionError(title)

    # send batch delete request
        try:
            self.dropbox.files_delete_batch(delete_list)
        except:
            raise DropboxConnectionError(title)
    
    # return outcome
        insert = 'collection'
        if self.collection_name:
            insert = self.collection_name
        exit_msg = 'Contents of %s will been removed from Dropbox.' % insert
        return exit_msg
 
            a method to remove all records in the collection

        NOTE:   this method removes all the files in the collection, but the
                collection folder itself created by oauth2 cannot be removed.
                only the user can remove the app folder
                
        :return: string with confirmation of deletion
        
a method to remove all records in the collection
NOTE:   this method removes all the files in the collection, but the
collection folder itself created by oauth2 cannot be removed.
only the user can remove the app folder
a method to remove all records in the collection NOTE : this method removes all the files in the collection but the collection folder itself created by oauth2 cannot be removed . only the user can remove the app folder
def remove(self):
        title = '%s.remove' % self.__class__.__name__
        try:
            response = self.dropbox.files_list_folder(path='')
        except:
            raise DropboxConnectionError(title)
        delete_list = []
        for file in response.entries:
            delete_list.append(self.objects.DeleteArg(path=file.path_display))
        if response.has_more:
            try:
                while response.has_more:
                    response = self.dropbox.files_list_folder_continue(response.cursor)
                    for file in response.entries:
                        delete_list.append(self.objects.DeleteArg(path=file.path_display))
            except:
                raise DropboxConnectionError(title)
        try:
            self.dropbox.files_delete_batch(delete_list)
        except:
            raise DropboxConnectionError(title)
        insert = 'collection'
        if self.collection_name:
            insert = self.collection_name
        exit_msg = 'Contents of %s will been removed from Dropbox.' % insert
        return exit_msg
def remove ( self ) : title = '%s.remove' % self . __class__ . __name__ try : response = self . dropbox . files_list_folder ( path = '' ) except : raise DropboxConnectionError ( title ) delete_list = [ ] for file in response . entries : delete_list . append ( self . objects . DeleteArg ( path = file . path_display ) ) if response . has_more : try : while response . has_more : response = self . dropbox . files_list_folder_continue ( response . cursor ) for file in response . entries : delete_list . append ( self . objects . DeleteArg ( path = file . path_display ) ) except : raise DropboxConnectionError ( title ) try : self . dropbox . files_delete_batch ( delete_list ) except : raise DropboxConnectionError ( title ) insert = 'collection' if self . collection_name : insert = self . collection_name exit_msg = 'Contents of %s will been removed from Dropbox.' % insert return exit_msg
a method to remove all records in the collection
NOTE:   this method removes all the files in the collection, but the
collection folder itself created by oauth2 cannot be removed.
a method to remove all records in the collection NOTE : this method removes all the files in the collection but the collection folder itself created by oauth2 cannot be removed .
''' 
            a method to remove all records in the collection

        NOTE:   this method removes all the files in the collection, but the
                collection folder itself created by oauth2 cannot be removed.
                only the user can remove the app folder
                
        :return: string with confirmation of deletion
        ''' # get contents in root
 # populate delete list
 # continue retrieval if folder is large
 # send batch delete request
 # return outcome

string with confirmation of deletion
string with confirmation of deletion
self