How to use the lupa.as_attrgetter function in lupa

To help you get started, we’ve selected a few lupa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airscript / airscript-engine / runtime / __init__.py View on Github external
end
    {0}
end
""".format(source))
    except Exception, e:
        raise e
        #return "Bad source", 400
    
    globals = _export_globals()
    globals['request'] = adapt_request(request)
    globals['require'] = lua.eval("""
function(name) 
    return loadstring(http.load(name))()
end""")
    return adapt_response(
        app(lupa.as_attrgetter(globals)))
github airscript / airscript-engine / runtime / __init__.py View on Github external
def make_table(dict):
    return lua.eval("""
function(d)
    local t = {}
    for key, value in python.iterex(d.items()) do
        t[key] = value
    end
    return t
end
""")(lupa.as_attrgetter(dict))

lupa

Python wrapper around Lua and LuaJIT

MIT
Latest version published 6 months ago

Package Health Score

80 / 100
Full package analysis

Similar packages