src/cm/utils/misc.py
author gibus
Tue, 24 Apr 2012 16:09:35 +0200
changeset 411 0056e6cd95e1
parent 0 40c8f766c9b8
permissions -rw-r--r--
When exporting, expand entities to keep correct offsets of comments.


def update(obj, kwargs):
    """
    Update obj attributes with values from kwargs
    """
    for k,v in kwargs.items():
        if hasattr(obj,k):
            setattr(obj,k,v)