Ńň
XÁĹGc           @   s\   d  Z  d d k Td d k Td d k Td e f d     YZ h  a d   Z h  a d   Z	 d S(   s&   
Various helpers for interface files.
i˙˙˙˙(   t   *t   FunctionWrapperc           B   s#   e  Z d  Z d d  Z d   Z RS(   s^  Holds information about a wrapper for a function or a method. It is
    divided in 2 parts: the name of the Wrapper, and its code.  The code is
    placed in the declaration section of the module, while the name is used to
    def' the function or method (with the pyste namespace prepend to it). If
    code is None, the name is left unchanged.
    c         C   s   | |  _  | |  _ d  S(   N(   t   namet   code(   t   selfR   R   (    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt   __init__   s    	c         C   s$   |  i  o t i |  i S|  i Sd  S(   N(   R   t
   namespacest   pysteR   (   R   (    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt   FullName   s    
N(   t   __name__t
   __module__t   __doc__t   NoneR   R   (    (    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyR      s   c         C   sÓ   d   } d   } |  i  } | |  p | |  o | S| d j o* | i o  t | t  o t t  } n t | t t f  } | oB | d j o5 d |  i   } | t	 j o | GHHd t	 | <qĎ n | S(   sÖ   Show a warning to the user if the function needs a policy and doesn't
    have one. Return a policy to the function, which is the given policy itself
    if it is not None, or a default policy for this method.
    c         S   s   |  i    d j S(   s;   Return True if the Type instance can be considered a strings   const char*(   R   (   t   type(    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt   IsString/   s    c         S   s   |  i    d j S(   Ns	   _object *(   R   (   R   (    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt
   IsPyObject3   s    sM   ---> Error: %s returns a pointer or a reference, but no policy was specified.i   N(
   t   resultR   t   constt
   isinstancet   ReferenceTypet   return_value_policyt   copy_const_referencet   PointerTypeR   t   _printed_warnings(   t   functiont   policyR   R   R   t   needs_policyt   warning(    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt   HandlePolicy)   s     			'c         C   s.   d |  } | t  j o d t  | <| Sd  Sd  S(   Ns,   BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(%s)
i   (   t   _exported_type_idsR   (   t   typenamet   macro(    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt   EspecializeTypeIDP   s
    

N(
   R   t   settingst   policiest   declarationst   objectR   R   R   R   R    (    (    (    s3   /usr/lib/pymodules/python2.6/Pyste/exporterutils.pyt   <module>   s   


	&