'Updates the preference values in opts1 using only the non-default preference values in opts2.'

def smart_update(self, opts1, opts2):

    for pref in self.preferences:
        new = getattr(opts2, pref.name, pref.default)
        if (new != pref.default):
            setattr(opts1, pref.name, new)
