labpack/storage/dropbox.py
def exists(self, record_key):
        
        ''' 
            a method to determine if a record exists in collection

        :param record_key: string with key of record
        :return: boolean reporting status
        '''
        
        title = '%s.exists' % self.__class__.__name__
    
    # validate inputs
        input_fields = {
            'record_key': record_key
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
    
    # send get metadata request
        file_path = '/%s' % record_key
        try:
            self.dropbox.files_get_metadata(file_path)
        except Exception as err:
            if str(err).find("LookupError('not_found'") > -1:
                return False
            else:
                raise DropboxConnectionError(title)

        return True
 
            a method to determine if a record exists in collection

        :param record_key: string with key of record
        :return: boolean reporting status
        
a method to determine if a record exists in collection
a method to determine if a record exists in collection
def exists(self, record_key):
        title = '%s.exists' % self.__class__.__name__
        input_fields = {
            'record_key': record_key
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
        file_path = '/%s' % record_key
        try:
            self.dropbox.files_get_metadata(file_path)
        except Exception as err:
            if str(err).find("LookupError('not_found'") > -1:
                return False
            else:
                raise DropboxConnectionError(title)
        return True
def exists ( self , record_key ) : title = '%s.exists' % self . __class__ . __name__ input_fields = { 'record_key' : record_key } for key , value in input_fields . items ( ) : object_title = '%s(%s=%s)' % ( title , key , str ( value ) ) self . fields . validate ( value , '.%s' % key , object_title ) file_path = '/%s' % record_key try : self . dropbox . files_get_metadata ( file_path ) except Exception as err : if str ( err ) . find ( "LookupError('not_found'" ) > - 1 : return False else : raise DropboxConnectionError ( title ) return True
a method to determine if a record exists in collection
a method to determine if a record exists in collection
''' 
            a method to determine if a record exists in collection

        :param record_key: string with key of record
        :return: boolean reporting status
        ''' # validate inputs
 # send get metadata request

boolean reporting status
boolean reporting status
self
record_key
string with key of record
string with key of record