Lines Matching refs:RExec

19 This module contains the :class:`RExec` class, which supports :meth:`r_eval`,
24 functions that are deemed safe; you can subclass :class:`RExec` to add or remove
39 The :class:`RExec` class can prevent code from performing unsafe operations like
44 .. class:: RExec([hooks[, verbose]])
46 Returns an instance of the :class:`RExec` class.
53 created by its constructor. (Actually, the :class:`RExec` object doesn't make
55 :class:`RExec` object. This allows another level of flexibility, which can be
89 RExec Objects
92 :class:`RExec` instances support the following methods:
95 .. method:: RExec.r_eval(code)
103 .. method:: RExec.r_exec(code)
110 .. method:: RExec.r_execfile(filename)
120 .. method:: RExec.s_eval(code)
126 .. method:: RExec.s_exec(code)
132 .. method:: RExec.s_execfile(code)
137 :class:`RExec` objects must also support various methods which will be
143 .. method:: RExec.r_import(modulename[, globals[, locals[, fromlist]]])
149 .. method:: RExec.r_open(filename[, mode[, bufsize]])
153 instance compatible with file objects) should be returned. :class:`RExec`'s
159 .. method:: RExec.r_reload(module)
164 .. method:: RExec.r_unload(module)
172 .. method:: RExec.s_import(modulename[, globals[, locals[, fromlist]]])
178 .. method:: RExec.s_reload(module)
183 .. method:: RExec.s_unload(module)
195 The :class:`RExec` class has the following class attributes, which are used by
197 any effect; instead, create a subclass of :class:`RExec` and assign them new
202 .. attribute:: RExec.nok_builtin_names
205 programs running in the restricted environment. The value for :class:`RExec` is
213 .. attribute:: RExec.ok_builtin_modules
216 for :class:`RExec` is ``('audioop', 'array', 'binascii', 'cmath', 'errno',
222 .. attribute:: RExec.ok_path
225 performed in the restricted environment. The value for :class:`RExec` is the
229 .. attribute:: RExec.ok_posix_names
233 :class:`RExec` is ``('error', 'fstat', 'listdir', 'lstat', 'readlink', 'stat',
240 .. attribute:: RExec.ok_sys_names
244 for :class:`RExec` is ``('ps1', 'ps2', 'copyright', 'version', 'platform',
248 .. attribute:: RExec.ok_file_types
253 The value for :class:`RExec` is ``(C_EXTENSION, PY_SOURCE)``. Adding
265 :class:`RExec` class. For example, if we're willing to allow files in
266 :file:`/tmp` to be written, we can subclass the :class:`RExec` class::
268 class TmpWriterRExec(rexec.RExec):