Changes a preference value and saves it to disk

def pref_update(self, key, new_val):
        """ Changes a preference value and saves it to disk """
        print('Update and save pref from: %s=%r, to: %s=%r' %
              (key, six.text_type(self[key]), key, six.text_type(new_val)))
        self.__setattr__(key, new_val)
        return self.save()