(name, id=None)
return obj
Given a name, return a behaviored ContentLine or Component.
Given a name, return a behaviored ContentLine or Component.
Given a name return a behaviored ContentLine or Component .
def newFromBehavior(name, id=None):
    """
    Given a name, return a behaviored ContentLine or Component.
    """
    name = name.upper()
    behavior = getBehavior(name, id)
    if behavior is None:
        raise VObjectError("No behavior found named {0!s}".format(name))
    if behavior.isComponent:
        obj = Component(name)
    else:
        obj = ContentLine(name, [], '')
    obj.behavior = behavior
    obj.isNative = False
    return obj
def newFromBehavior ( name , id = None ) : name = name . upper ( ) behavior = getBehavior ( name , id ) if behavior is None : raise VObjectError ( "No behavior found named {0!s}" . format ( name ) ) if behavior . isComponent : obj = Component ( name ) else : obj = ContentLine ( name , [ ] , '' ) obj . behavior = behavior obj . isNative = False return obj