HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/__pycache__/contextlib.cpython-35.pyc


Fan0@sdZddlZddlmZddlmZddddd	d
dgZGdddeZGd
ddeZ	ddZ
GdddeZGdddZGdd	d	eZ
Gdd
d
eZGdddZGdddeZdS)z4Utilities for with-statement contexts.  See PEP 343.N)deque)wrapscontextmanagerclosingContextDecorator	ExitStackredirect_stdoutredirect_stderrsuppressc@s.eZdZdZddZddZdS)rzJA base class or mixin that enables context managers to work as decorators.cCs|S)a6Return a recreated instance of self.

        Allows an otherwise one-shot context manager like
        _GeneratorContextManager to support use as
        a decorator via implicit recreation.

        This is a private interface just for _GeneratorContextManager.
        See issue #11647 for details.
        )selfrr /usr/lib/python3.5/contextlib.py_recreate_cms
zContextDecorator._recreate_cmcs%tfdd}|S)Nc
s%j||SWdQRXdS)N)r)argskwds)funcrrr
inners
z(ContextDecorator.__call__.<locals>.inner)r)rrrr)rrr
__call__s!zContextDecorator.__call__N)__name__
__module____qualname____doc__rrrrrr
rsc@sFeZdZdZddZddZddZdd	Zd
S)_GeneratorContextManagerz%Helper for @contextmanager decorator.cCsi||||_||||_|_|_t|dd}|dkr\t|j}||_dS)Nr)genrrrgetattrtyper)rrrrdocrrr
__init__%sz!_GeneratorContextManager.__init__cCs|j|j|j|jS)N)	__class__rrr)rrrr
r3sz%_GeneratorContextManager._recreate_cmcCs9yt|jSWn!tk
r4tddYnXdS)Nzgenerator didn't yield)nextr
StopIterationRuntimeError)rrrr
	__enter__9s
z"_GeneratorContextManager.__enter__cCs |dkrEyt|jWntk
r5dSYqXtdn|dkrZ|}y&|jj|||tdWntk
r}z||k	SWYdd}~Xnktk
r}z+||krdS|j|krdSWYdd}~Xn!tjd|k	rYnXdS)Nzgenerator didn't stopz#generator didn't stop after throw()F)rrr r!throw	__cause__sysexc_info)rrvalue	tracebackexcrrr
__exit__?s,
		z!_GeneratorContextManager.__exit__N)rrrrrrr"r+rrrr
r"s
rcs"tfdd}|S)a@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>

    cst||S)N)r)rr)rrr
helperszcontextmanager.<locals>.helper)r)rr,r)rr
rjsc@s:eZdZdZddZddZddZdS)	ra2Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    cCs
||_dS)N)thing)rr-rrr
rszclosing.__init__cCs|jS)N)r-)rrrr
r"szclosing.__enter__cGs|jjdS)N)r-close)rr'rrr
r+szclosing.__exit__N)rrrrrr"r+rrrr
rsc@s:eZdZdZddZddZddZdS)_RedirectStreamNcCs||_g|_dS)N)_new_target_old_targets)r
new_targetrrr
rs	z_RedirectStream.__init__cCs9|jjtt|jtt|j|j|jS)N)r1appendrr&_streamsetattrr0)rrrr
r"sz_RedirectStream.__enter__cCs tt|j|jjdS)N)r5r&r4r1pop)rexctypeexcinstexctbrrr
r+sz_RedirectStream.__exit__)rrrr4rr"r+rrrr
r/sr/c@seZdZdZdZdS)raAContext manager for temporarily redirecting stdout to another file.

        # How to send help() to stderr
        with redirect_stdout(sys.stderr):
            help(dir)

        # How to write help() to a file
        with open('help.txt', 'w') as f:
            with redirect_stdout(f):
                help(pow)
    stdoutN)rrrrr4rrrr
rsc@seZdZdZdZdS)r	zCContext manager for temporarily redirecting stderr to another file.stderrN)rrrrr4rrrr
r	sc@s:eZdZdZddZddZddZdS)	r
a?Context manager to suppress specified exceptions

    After the exception is suppressed, execution proceeds with the next
    statement following the with statement.

         with suppress(FileNotFoundError):
             os.remove(somefile)
         # Execution still resumes here if the file was already removed
    cGs
||_dS)N)_exceptions)r
exceptionsrrr
rszsuppress.__init__cCsdS)Nr)rrrr
r"szsuppress.__enter__cCs|dk	ot||jS)N)
issubclassr<)rr7r8r9rrr
r+s
zsuppress.__exit__N)rrrrrr"r+rrrr
r
s	c@seZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZdS)raContext manager for dynamic management of a stack of exit callbacks

    For example:

        with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception

    cCst|_dS)N)r_exit_callbacks)rrrr
rszExitStack.__init__cCs+t|}|j|_t|_|S)z?Preserve the context stack by transferring it to a new instance)rr?r)r	new_stackrrr
pop_allszExitStack.pop_allcs/fdd}|_|j|dS)z:Helper to correctly register callbacks to __exit__ methodscs
|S)Nr)exc_details)cmcm_exitrr

_exit_wrappersz.ExitStack._push_cm_exit.<locals>._exit_wrapperN)__self__push)rrCrDrEr)rCrDr

_push_cm_exits	zExitStack._push_cm_exitcCsRt|}y
|j}Wn"tk
r=|jj|YnX|j|||S)aRegisters a callback with the standard __exit__ method signature

        Can suppress exceptions the same way __exit__ methods can.

        Also accepts any object with an __exit__ method (registering a call
        to the method instead of the object itself)
        )rr+AttributeErrorr?r3rH)rexit_cb_typeexit_methodrrr
rG	s


zExitStack.pushcs2fdd}|_|j|S)z\Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        csdS)Nr)exc_typer*tb)rcallbackrrr
rE"sz)ExitStack.callback.<locals>._exit_wrapper)__wrapped__rG)rrOrrrEr)rrOrr
rOs	
zExitStack.callbackcCs8t|}|j}|j|}|j|||S)zEnters the supplied context manager

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        )rr+r"rH)rrC_cm_type_exitresultrrr

enter_context*s
	zExitStack.enter_contextcCs|jddddS)z$Immediately unwind the context stackN)r+)rrrr
r.7szExitStack.closecCs|S)Nr)rrrr
r";szExitStack.__enter__c	s|ddk	}tjdfdd}d}d}xv|jr|jj}y"||rzd}d}d}WqAtj}||d|dd}|}YqAXqAW|ry|dj}|dWn"tk
r||d_YnX|o|S)Nrr#csLx<|j}||krdS|dks4|kr5P|}qW||_dS)N)__context__)new_excold_excexc_context)	frame_excrr
_fix_exception_contextDs	
z2ExitStack.__exit__.<locals>._fix_exception_contextFT)NNN)r&r'r?r6rU
BaseException)	rrBreceived_excrZsuppressed_exc
pending_raisecbnew_exc_details	fixed_ctxr)rYr
r+>s2



zExitStack.__exit__N)
rrrrrrArHrGrOrTr.r"r+rrrr
rs

)rr&collectionsr	functoolsr__all__objectrrrrr/rr	r
rrrrr
<module>sH"