
    _eG                     b   d Z ddlmZ ddlmZ  G d de      Zd Zedk(  rddlm	Z	 e	j                  Zg Zd	 Z  ee      e      Z e        ej                   d
k(  sJ ej                  j                  dk(  sJ ej                  dk(  sJ ej                   eu sJ ej"                  eu sJ esJ yy)z6Simplistic wrapper decorator for Python-coded wrappers    )Curry)MODULE_ANNOTATIONSc                       e Zd ZdZy)_LazyWrapperz2Marker to tell us that an object is a lazy wrapperN)__name__
__module____qualname____doc__     4/usr/lib/python3/dist-packages/OpenGL/lazywrapper.pyr   r      s    <r   r   c                       fd}|S )a  Produce a lazy-binding decorator that uses baseFunction

    Allows simple implementation of wrappers where the
    whole of the wrapper can be summed up as do 1 thing
    then call base function with the cleaned up result.

    Passes baseFunction in as the first argument of the
    wrapped function, all other parameters are passed
    unchanged.  The wrapper class created has __nonzero__
    and similar common wrapper entry points defined.
    c                    fd}fd}t        | j                  t        f|| j                  ||t	        | dt	        dd            d      } ||       }| j                  |_        t        d      rj                  |_        |S )zWrap wrapper with baseFunctionc                     t              S )N)boolselfbaseFunctions    r   __bool__z$lazy.<locals>.wrap.<locals>.__bool__   s    ''r   c                 (    ddj                   dS )NzOpenGL.lazywrapper.lazyz( z ))r   r   s    r   __repr__z$lazy.<locals>.wrap.<locals>.__repr__   s    )%% r   restypeN)r   r
   __nonzero__r   wrappedOperationr   r   )typer   r   r
   getattrhasattrr   )wrapperr   r   _with_wrapperwith_wrapperr   s        r   wrapzlazy.<locals>.wrap   s    	(	
 g.. #  ,w	',yQU2VWB
  %W\: ' 0 0L,0&2&=&=L#r   r   )r   r!   s   ` r   lazyr"      s    , Kr   __main__)GLUc                 .    t         j                  |        y)TestingN)outputappend)bases    r   testwrapr*   1   s    tr   r&   r*   N)r
   OpenGL.latebindr   OpenGLr   r   r"   r   
OpenGL.rawr$   gluNurbsCallbackDatafuncr'   r*   testlazy	__class__r   wrapperFunctionr   r   r   <module>r3      s    < ! %=E ="J z##DF tT|X'HKy(((&&*444
***  D(((##x///M6 r   