Server: appserver-7f0f8755-nginx-15961cad18524ec5a9db05f2a6a7e440
Current directory: /usr/lib/python2.7
Software: nginx/1.27.5
Shell Command
Create a new file
Upload file
File: rexec.pyc
� ӫ[c @ s# d Z d d l m Z e d d d �[ d d l Z d d l Z d d l Z d d l Z d d l Z d g Z d f d � � YZ d e f d � � YZ d Z d e f d � � YZ d e j f d � � YZ e j Z e j Z d e j f d � � YZ d � Z e d k re j e � � n d S( s9 Restricted execution facilities. The class RExec exports methods r_exec(), r_eval(), r_execfile(), and r_import(), which correspond roughly to the built-in operations exec, eval(), execfile() and import, but executing the code in an environment that only exposes those built-in operations that are deemed safe. To this end, a modest collection of 'fake' modules is created which mimics the standard modules by the same names. It is a policy decision which built-in modules and operations are made available; this module provides a reasonable default, but derived classes can change the policies e.g. by overriding or extending class variables like ok_builtin_modules or methods like make_sys(). XXX To do: - r_open should allow writing tmp dir - r_exec etc. with explicit globals/locals? (Use rexec("exec ... in ...")?) i����( t warnpy3ks/ the rexec module has been removed in Python 3.0t stackleveli Nt RExect FileBasec B s e Z d Z RS( t filenot flusht isattyt readt readlinet readlinest seekt tellt writet writelinest xreadlinest __iter__( R R R R R R R R R R R R ( t __name__t __module__t ok_file_methods( ( ( s /usr/lib/python2.7/rexec.pyR s t FileWrapperc B s e Z d � Z d � Z RS( c C sS xL | j D]A } t | | � r t | | � r t | | t | | � � q q Wd S( N( R t hasattrt setattrt getattr( t selft ft m( ( s /usr/lib/python2.7/rexec.pyt __init__+ s c C s | j � d S( N( R ( R ( ( s /usr/lib/python2.7/rexec.pyt close0 s ( R R R R ( ( ( s /usr/lib/python2.7/rexec.pyR ' s sL def %s(self, *args): return getattr(self.mod, self.name).%s(*args) t FileDelegatec B s; e Z d � Z x' e j d D] Z e e e f d Uq WRS( c C s | | _ | | _ d S( N( t modt name( R R R ( ( s /usr/lib/python2.7/rexec.pyR ; s R N( R ( R R R R R R t TEMPLATE( ( ( s /usr/lib/python2.7/rexec.pyR 9 s t RHooksc B s} e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( c G s� d } d } | rE t | d � t d � k rE | d } | d } n | ru t | d d � ru | d } | d } n | r� t d � n t j j | | � | | _ d S( Ni i����t __class__i s too many arguments( t Nonet typeR t TypeErrort ihookst HooksR t rexec( R t argst verboseR' ( ( s /usr/lib/python2.7/rexec.pyR E s " c C s | | _ d S( N( R' ( R R' ( ( s /usr/lib/python2.7/rexec.pyt set_rexecV s c C s | j j � S( N( R' t get_suffixes( R ( ( s /usr/lib/python2.7/rexec.pyR+ Z s c C s | j j | � S( N( R' t is_builtin( R R ( ( s /usr/lib/python2.7/rexec.pyR, ] s c C s t | � } | j j | d � S( N( ( t __import__R' t copy_except( R R R ( ( s /usr/lib/python2.7/rexec.pyt init_builtin` s c C s t d � d S( Ns don't use this( t SystemError( R R ( ( s /usr/lib/python2.7/rexec.pyt init_frozend s c G s t d � d S( Ns don't use this( R0 ( R R( ( ( s /usr/lib/python2.7/rexec.pyt load_sourcee s c G s t d � d S( Ns don't use this( R0 ( R R( ( ( s /usr/lib/python2.7/rexec.pyt load_compiledf s c G s t d � d S( Ns don't use this( R0 ( R R( ( ( s /usr/lib/python2.7/rexec.pyt load_packageg s c C s | j j | | | � S( N( R' t load_dynamic( R R t filenamet file( ( s /usr/lib/python2.7/rexec.pyR5 i s c C s | j j | � S( N( R' t add_module( R R ( ( s /usr/lib/python2.7/rexec.pyR8 l s c C s | j j S( N( R' t modules( R ( ( s /usr/lib/python2.7/rexec.pyt modules_dicto s c C s | j j d j S( Nt sys( R' R9 t path( R ( ( s /usr/lib/python2.7/rexec.pyt default_pathr s ( R R R R* R+ R, R/ R1 R2 R3 R4 R5 R8 R: R= ( ( ( s /usr/lib/python2.7/rexec.pyR C s c B s� e Z d Z e e j � Z dX Z dY Z dZ Z d[ Z e j e j f Z d\ d3 d4 � Z d5 � Z d6 � Z d7 � Z d8 � Z d9 � Z d: � Z d; � Z d<