'Set the download state callback. Remove any old callback if it\'s present.'

def set_download_states_callback(self, user_callback, interval=1.0):

    self.stop_download_states_callback()
    self._logger.debug('Starting    the    download    state    callback    with    interval    %f', interval)
    self.download_states_lc = self.register_task('download_states_lc', LoopingCall(self._invoke_states_cb, user_callback))
    self.download_states_lc.start(interval)
