src/cm/utils/misc.py
author gibus
Thu, 09 Aug 2012 13:05:11 +0200
changeset 458 ba7e05582435
parent 0 40c8f766c9b8
permissions -rw-r--r--
When extracting body of a document in HTML source format (i.e. without pandoc conversion before display), use BeautifilSoup, which is more tolerant, instead of xml.dom.minidom, which crashes too often.


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)