403Webshell
Server IP : 80.241.246.6  /  Your IP : 216.73.216.129
Web Server : Apache/2.4.25 (Debian)
System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User : www-data ( 33)
PHP Version : 7.0.33-0+deb9u12
Disable Function : 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,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/thread-self/root/usr/lib/python3/dist-packages/zope/hookable/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/usr/lib/python3/dist-packages/zope/hookable/__init__.py
##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Hookable object support
"""

class _py_hookable(object):
    __slots__ = ('_original', '_implementation')
    
    def __init__(self, *args, **kw):
        if len(args) == 0 and 'implementation' in kw:
            args = (kw.pop('implementation'),)
        if kw:
            raise TypeError('Unknown keyword arguments')
        if len(args) != 1:
            raise TypeError('Exactly one argument required')
        self._original = self._implementation = args[0]

    original = property(lambda self: self._original)
    implementation = property(lambda self: self._implementation)

    def sethook(self, new_callable):
        old, self._implementation = self._implementation, new_callable
        return old

    def reset(self):
        self._implementation = self._original

    def __call__(self, *args, **kw):
        return self._implementation(*args, **kw)

hookable = _py_hookable

try:
    from ._zope_hookable import hookable
except ImportError: #pragma NO COVER
    pass

Youez - 2016 - github.com/yon3zu
LinuXploit