✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server303.web-hosting.com ​🇻​♯➤ 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 199.188.205.31 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.120
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /usr/lib64/python2.7/Demo/metaclasses//Meta.py
"""Generic metaclass.

XXX This is very much a work in progress.

"""

import types

class MetaMethodWrapper:

    def __init__(self, func, inst):
        self.func = func
        self.inst = inst
        self.__name__ = self.func.__name__

    def __call__(self, *args, **kw):
        return apply(self.func, (self.inst,) + args, kw)

class MetaHelper:

    __methodwrapper__ = MetaMethodWrapper # For derived helpers to override

    def __helperinit__(self, formalclass):
        self.__formalclass__ = formalclass

    def __getattr__(self, name):
        # Invoked for any attr not in the instance's __dict__
        try:
            raw = self.__formalclass__.__getattr__(name)
        except AttributeError:
            try:
                ga = self.__formalclass__.__getattr__('__usergetattr__')
            except (KeyError, AttributeError):
                raise AttributeError, name
            return ga(self, name)
        if type(raw) != types.FunctionType:
            return raw
        return self.__methodwrapper__(raw, self)

class MetaClass:

    """A generic metaclass.

    This can be subclassed to implement various kinds of meta-behavior.

    """

    __helper__ = MetaHelper             # For derived metaclasses to override

    __inited = 0

    def __init__(self, name, bases, dict):
        try:
            ga = dict['__getattr__']
        except KeyError:
            pass
        else:
            dict['__usergetattr__'] = ga
            del dict['__getattr__']
        self.__name__ = name
        self.__bases__ = bases
        self.__realdict__ = dict
        self.__inited = 1

    def __getattr__(self, name):
        try:
            return self.__realdict__[name]
        except KeyError:
            for base in self.__bases__:
                try:
                    return base.__getattr__(name)
                except AttributeError:
                    pass
            raise AttributeError, name

    def __setattr__(self, name, value):
        if not self.__inited:
            self.__dict__[name] = value
        else:
            self.__realdict__[name] = value

    def __call__(self, *args, **kw):
        inst = self.__helper__()
        inst.__helperinit__(self)
        try:
            init = inst.__getattr__('__init__')
        except AttributeError:
            init = lambda: None
        apply(init, args, kw)
        return inst


Meta = MetaClass('Meta', (), {})


def _test():
    class C(Meta):
        def __init__(self, *args):
            print "__init__, args =", args
        def m1(self, x):
            print "m1(x=%r)" % (x,)
    print C
    x = C()
    print x
    x.m1(12)
    class D(C):
        def __getattr__(self, name):
            if name[:2] == '__': raise AttributeError, name
            return "getattr:%s" % name
    x = D()
    print x.foo
    print x._foo
##     print x.__foo
##     print x.__foo__


if __name__ == '__main__':
    _test()


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
15 Jun 2024 8.33 AM
root / root
0755
Eiffel.py
3.387 KB
19 Apr 2020 9.13 PM
root / root
0644
Eiffel.pyc
4.523 KB
10 Apr 2024 4.58 AM
root / root
0644
Eiffel.pyo
4.424 KB
10 Apr 2024 4.58 AM
root / root
0644
Enum.py
4.315 KB
19 Apr 2020 9.13 PM
root / root
0644
Enum.pyc
6.034 KB
10 Apr 2024 4.58 AM
root / root
0644
Enum.pyo
6.034 KB
10 Apr 2024 4.58 AM
root / root
0644
Meta.py
2.864 KB
19 Apr 2020 9.13 PM
root / root
0644
Meta.pyc
4.472 KB
10 Apr 2024 4.58 AM
root / root
0644
Meta.pyo
4.472 KB
10 Apr 2024 4.58 AM
root / root
0644
Simple.py
1.164 KB
19 Apr 2020 9.13 PM
root / root
0644
Simple.pyc
2.682 KB
10 Apr 2024 4.58 AM
root / root
0644
Simple.pyo
2.682 KB
10 Apr 2024 4.58 AM
root / root
0644
Synch.py
7.752 KB
19 Apr 2020 9.13 PM
root / root
0644
Synch.pyc
8.264 KB
10 Apr 2024 4.58 AM
root / root
0644
Synch.pyo
8.119 KB
10 Apr 2024 4.58 AM
root / root
0644
Trace.py
4.036 KB
19 Apr 2020 9.13 PM
root / root
0644
Trace.pyc
6.028 KB
10 Apr 2024 4.58 AM
root / root
0644
Trace.pyo
6.028 KB
10 Apr 2024 4.58 AM
root / root
0644
index.html
20.091 KB
19 Apr 2020 9.13 PM
root / root
0644
meta-vladimir.txt
11.257 KB
19 Apr 2020 9.13 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF