(self, data, replace=False)
takes a whole dictionary of values and sets them
takes a whole dictionary of values and sets them
takes a whole dictionary of values and sets them
def add_metadata(self, data, replace=False):
        '''takes a whole dictionary of values and sets them'''
        metadata_mode = "json"

        if metadata_mode == 'json':
            if replace:
                self.metadata = data
                self.set_json_value("metadata", data)
            else:
                for name, value in data.items():
                    self.set_metadata_value(name, value)

        else:
            if replace:
                self.set_value("metadata", "<metadata/>")
                self.metadata = None

            for name, value in data.items():
                self.set_metadata_value(name, value)
def add_metadata ( self , data , replace = False ) : metadata_mode = "json" if metadata_mode == 'json' : if replace : self . metadata = data self . set_json_value ( "metadata" , data ) else : for name , value in data . items ( ) : self . set_metadata_value ( name , value ) else : if replace : self . set_value ( "metadata" , "<metadata/>" ) self . metadata = None for name , value in data . items ( ) : self . set_metadata_value ( name , value )