コード例 #1
0
 def start_main(self, lua_source):
     """
     Start "main" function and return it as a coroutine.
     """
     splash_obj = self._get_wrapper()
     if self.sandboxed:
         main, env = get_main_sandboxed(self.lua, lua_source)
         main_coro = self._sandbox.create_coroutine(main)
         return main_coro(splash_obj)
     else:
         main, env = get_main(self.lua, lua_source)
         return main.coroutine(splash_obj)
コード例 #2
0
ファイル: qtrender_lua.py プロジェクト: shirk3y/splash
 def start_main(self, lua_source):
     """
     Start "main" function and return it as a coroutine.
     """
     splash_obj = self._get_wrapper()
     if self.sandboxed:
         main, env = get_main_sandboxed(self.lua, lua_source)
         main_coro = self._sandbox.create_coroutine(main)
         return main_coro(splash_obj)
     else:
         main, env = get_main(self.lua, lua_source)
         return main.coroutine(splash_obj)
コード例 #3
0
ファイル: qtrender_lua.py プロジェクト: getwingm/splash
 def start_main(self, lua_source):
     """
     Start "main" function and return it as a coroutine.
     """
     splash_obj = self.get_wrapper()
     if self.sandboxed:
         main, env = get_main_sandboxed(self.lua, lua_source)
         # self.script_globals = env  # XXX: does it work well with GC?
         create_coroutine = self.lua.globals()["create_sandboxed_coroutine"]
         coro = create_coroutine(main)
         return coro(splash_obj)
     else:
         main, env = get_main(self.lua, lua_source)
         # self.script_globals = env  # XXX: does it work well with GC?
         return main.coroutine(splash_obj)
コード例 #4
0
ファイル: qtrender_lua.py プロジェクト: stav/splash
 def get_main(self, lua_source):
     if self.sandboxed:
         main, env = get_main_sandboxed(self.lua, lua_source)
     else:
         main, env = get_main(self.lua, lua_source)
     return self.lua.create_coroutine(main)
コード例 #5
0
ファイル: kernel.py プロジェクト: yssoe/splash
 def _get_main(self, lua_source):
     if self.sandboxed:
         main, env = get_main_sandboxed(self.lua, lua_source)
     else:
         main, env = get_main(self.lua, lua_source)
     return self.lua.create_coroutine(main)