'Apply defaults to all class attributes which are None.
defaults
Dictionary containing a mapping from class attributes
to default values'

def applyDefaults(self, defaults):

    for k in defaults.keys():
        if (getattr(self, k) is None):
            setattr(self, k, defaults[k])
