예제 #1
0
파일: builder.py 프로젝트: mback2k/wpull
    def _install_python_script(self, filename):
        '''Load the Python script into an environment.'''
        _logger.info(__(_('Using Python hook script {filename}.'),
                        filename=filename))

        hook_environment = HookEnvironment(self._factory)

        hook_environment.connect_hooks()

        with open(filename, 'rb') as in_file:
            code = compile(in_file.read(), filename, 'exec')
            context = {'wpull_hook': hook_environment}
            exec(code, context, context)
예제 #2
0
파일: builder.py 프로젝트: mback2k/wpull
    def _install_lua_script(self, filename):
        '''Load the Lua script into an environment.'''
        _logger.info(__(_('Using Lua hook script {filename}.'),
                        filename=filename))

        lua = wpull.hook.load_lua()
        hook_environment = HookEnvironment(self._factory, is_lua=True)

        hook_environment.connect_hooks()

        lua_globals = lua.globals()
        lua_globals.wpull_hook = hook_environment

        with open(filename, 'rb') as in_file:
            lua.execute(in_file.read())
예제 #3
0
    def _install_python_script(self, filename):
        '''Load the Python script into an environment.'''
        _logger.info(
            _('Using Python hook script {filename}.').format(
                filename=filename))

        hook_environment = HookEnvironment()

        self._setup_hook_environment(hook_environment)

        with open(filename, 'rb') as in_file:
            code = compile(in_file.read(), filename, 'exec')
            context = {'wpull_hook': hook_environment}
            exec(code, context, context)
예제 #4
0
    def _install_lua_script(self, filename):
        '''Load the Lua script into an environment.'''
        _logger.info(
            _('Using Lua hook script {filename}.').format(filename=filename))

        lua = wpull.hook.load_lua()
        hook_environment = HookEnvironment(is_lua=True)

        self._setup_hook_environment(hook_environment)

        lua_globals = lua.globals()
        lua_globals.wpull_hook = hook_environment

        with open(filename, 'rb') as in_file:
            lua.execute(in_file.read())