'Import an object from a \'module.name\' string.'

def import_object(self, objname, source=None):

    try:
        (module, name) = objname.rsplit('.', 1)
    except ValueError as err:
        raise ExtensionError((('Invalid    full    object    name    %s' % objname) + ((source and ('    (needed    for    %s)' % source)) or '')), err)
    try:
        return getattr(__import__(module, None, None, [name]), name)
    except ImportError as err:
        raise ExtensionError((('Could    not    import    %s' % module) + ((source and ('    (needed    for    %s)' % source)) or '')), err)
    except AttributeError as err:
        raise ExtensionError((('Could    not    find    %s' % objname) + ((source and ('    (needed    for    %s)' % source)) or '')), err)
