
    d	                     v    d Z dZ G d d      Z G d d      Z G d de      Z G d d	e      Z G d
 de      Zy)zIProvides a variety of classes to create pseudo keywords and pseudo files.z(Patrick K. O'Brien <pobrien@orbtech.com>c                   "    e Zd ZdZd Zd Zd Zy)PseudoKeyworda,  A callable class that calls a method passed as a parameter.

    Good for creating a pseudo keyword in the python runtime
    environment. The keyword is really an object that has a repr()
    that calls itself which calls the method that was passed in the
    init of the object. All this just to avoid having to type in the
    closing parens on a method. So, for example:

        >>> quit = PseudoKeyword(SomeObject.someMethod)
        >>> quit

    SomeObject.someMethod gets executed as if it had been called
    directly and the user didn't have to type the parens, like
    'quit()'. This technique is most applicable for pseudo keywords
    like quit, exit and help.

    If SomeObject.someMethod can take parameters, they can still be
    passed by using the keyword in the traditional way with parens.c                 >    t        |      r|| _        yt        d      )z:Create a callable object that executes method when called.zmethod must be callableN)callablemethod
ValueError)selfr   s     ./usr/lib/python3/dist-packages/wx/py/pseudo.py__init__zPseudoKeyword.__init__   s     F DK677    c                 (     | j                   |i | y N)r   )r   argskwdss      r	   __call__zPseudoKeyword.__call__"   s    T"T"r   c                      |         y)N  r   s    r	   __repr__zPseudoKeyword.__repr__%   s
    r   N)__name__
__module____qualname____doc__r
   r   r   r   r   r	   r   r      s    G&8#r   r   c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)
PseudoFilec                      y)zCreate a file-like object.Nr   r   s    r	   r
   zPseudoFile.__init__,   s    r   c                      y r   r   r   s    r	   readlinezPseudoFile.readline0       r   c                      y r   r   )r   ss     r	   writezPseudoFile.write3   r   r   c                 0    t        | j                  |       y r   )mapr"   )r   ls     r	   
writelineszPseudoFile.writelines6   s    DJJr   c                      y r   r   r   s    r	   flushzPseudoFile.flush9   r   r   c                      y r   r   r   s    r	   isattyzPseudoFile.isatty<   r   r   N)	r   r   r   r
   r   r"   r&   r(   r*   r   r   r	   r   r   *   s     r   r   c                       e Zd ZddZd Zy)PseudoFileInNc                 f    t        |      r|| _        nt        d      t        |      r|| _        y y )Nzreadline must be callable)r   r   r   	readlines)r   r   r.   s      r	   r
   zPseudoFileIn.__init__B   s1    H$DM899I&DN r   c                      yN   r   r   s    r	   r*   zPseudoFileIn.isattyJ       r   r   r   r   r   r
   r*   r   r   r	   r,   r,   @   s    'r   r,   c                       e Zd Zd Zd Zy)PseudoFileOutc                 >    t        |      r|| _        y t        d      Nzwrite must be callabler   r"   r   r   r"   s     r	   r
   zPseudoFileOut.__init__P       E?DJ566r   c                      yr0   r   r   s    r	   r*   zPseudoFileOut.isattyV   r2   r   Nr3   r   r   r	   r5   r5   N       7r   r5   c                       e Zd Zd Zd Zy)PseudoFileErrc                 >    t        |      r|| _        y t        d      r7   r8   r9   s     r	   r
   zPseudoFileErr.__init__\   r:   r   c                      yr0   r   r   s    r	   r*   zPseudoFileErr.isattyb   r2   r   Nr3   r   r   r	   r>   r>   Z   r<   r   r>   N)r   
__author__r   r   r,   r5   r>   r   r   r	   <module>rB      sF    O7
! !H ,: 	J 		J 	r   