def getHandle(name):
    for handle in api.handles:
        if (handle.name == name[0]):
            return handle
    raise Exception(('No such handle: %s' % name))
def getHandle(name):
    for handle in api.handles:
        if (handle.name == name[0]):
            return handle
    raise Exception(('No such handle: %s' % name))