def getLayout(name, back=2):
    if name.endswith('.lay'):
        layout = tryToLoad(('layouts/' + name))
        if (layout == None):
            layout = tryToLoad(name)
    else:
        layout = tryToLoad((('layouts/' + name) + '.lay'))
        if (layout == None):
            layout = tryToLoad((name + '.lay'))
    if ((layout == None) and (back >= 0)):
        curdir = os.path.abspath('.')
        os.chdir('..')
        layout = getLayout(name, (back - 1))
        os.chdir(curdir)
    return layout
def getLayout(name, back=2):
    if name.endswith('.lay'):
        layout = tryToLoad(('layouts/' + name))
        if (layout == None):
            layout = tryToLoad(name)
    else:
        layout = tryToLoad((('layouts/' + name) + '.lay'))
        if (layout == None):
            layout = tryToLoad((name + '.lay'))
    if ((layout == None) and (back >= 0)):
        curdir = os.path.abspath('.')
        os.chdir('..')
        layout = getLayout(name, (back - 1))
        os.chdir(curdir)
    return layout