MCPcopy
hub / github.com/scrapinghub/splash / decodes_lua_arguments_wrapper

Function decodes_lua_arguments_wrapper

splash/qtrender_lua.py:177–192  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

175 def decorator(meth):
176 @functools.wraps(meth)
177 def decodes_lua_arguments_wrapper(self, *args, **kwargs):
178 try:
179 args = [
180 self.lua.lua2python(a, **l2p_kw)
181 for a in args
182 ]
183 kwargs = {
184 self.lua.lua2python(k): self.lua.lua2python(v, **l2p_kw)
185 for (k, v) in kwargs.items()
186 }
187 except ValueError as e:
188 raise ScriptError({
189 'type': ScriptError.SPLASH_LUA_ERROR,
190 'message': e.args[0],
191 })
192 return meth(self, *args, **kwargs)
193 return decodes_lua_arguments_wrapper
194 return decorator
195

Callers

nothing calls this directly

Calls 2

ScriptErrorClass · 0.90
lua2pythonMethod · 0.80

Tested by

no test coverage detected