messages/_config.py
def retrieve_data_from_config(msg, cfg):
    """
    Update msg attrs with values from the profile configuration if the
    msg.attr=None, else leave it alone.

    Args:
        :msg: (Message class) an instance of a message class.
        :cfg: (jsonconfig.Config) config instance.
    """
    msg_type = msg.__class__.__name__.lower()
    for attr in msg:
        if getattr(msg, attr) is None and attr in cfg.data[msg.profile][msg_type]:
            setattr(msg, attr, cfg.data[msg.profile][msg_type][attr])
def retrieve_data_from_config(msg, cfg):
    """
    Update msg attrs with values from the profile configuration if the
    msg.attr=None, else leave it alone.

    Args:
        :msg: (Message class) an instance of a message class.
        :cfg: (jsonconfig.Config) config instance.
    """
    msg_type = msg.__class__.__name__.lower()
    for attr in msg:
        if getattr(msg, attr) is None and attr in cfg.data[msg.profile][msg_type]:
            setattr(msg, attr, cfg.data[msg.profile][msg_type][attr])
Update msg attrs with values from the profile configuration if the
    msg.attr=None, else leave it alone.

    Args:
        :msg: (Message class) an instance of a message class.
        :cfg: (jsonconfig.Config) config instance.