ó
î%![c           @   s±   d  Z  d d l Z d d l Z d d l Z d d l Z e j j e j ƒ Z e j	 d ƒ d „ Z
 d „  Z d „  Z d „  Z e j e j d e ƒ e j j e j e d	 „  ƒ d S(
   s   Hooks for nose library.iÿÿÿÿNs   ([A-Z])c         C   s   | j  d „  |  ƒ S(   Nc         S   s   d |  j  ƒ  d j ƒ  S(   Nt   _i    (   t   groupst   lower(   t   m(    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyt   <lambda>   s    (   t   sub(   t   namet   caps(    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyt   _pep8   s    c          c   sØ   t  j t j d ƒ ƒ }  y t |  d j ƒ  ƒ } Wn t j k
 rI d SXx‡ | j ƒ  D]y } | j	 j
 d ƒ r§ d | j	 k r§ t | j	 ƒ } | t j | | ƒ f Vn  | j	 d k rW d t j | | ƒ f VqW qW Wd S(   s+   Get an iterator of names and bound methods.sY   
    import unittest

    class Test(unittest.TestCase):
        pass
    a = Test()
    t   aNt   assertR    t   assertEqualt   assert_equals(   t   _BUILDERt   string_buildt   textwrapt   dedentt   nextt   infert   astroidt   InferenceErrort   methodsR   t
   startswithR   t   BoundMethod(   t   modulet   caset   methodt	   pep8_name(    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyt   _nose_tools_functions   s    !c         C   s.   x' t  ƒ  D] \ } } | g |  j | <q
 Wd  S(   N(   R   t   locals(   t   nodet   method_nameR   (    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyt   _nose_tools_transform,   s    c          C   s~   t  j d ƒ }  d d g } x. t ƒ  D]# \ } } | j | ƒ | |  | <q% W|  d j } t j | ƒ } | | _ | | _ |  S(   s+   Custom transform for the nose.tools module.s   __all__ = []t   ok_t   eq_t   __all__(   R   R   R   t   appendt   parentR   t   Listt   value(   t   stubt   all_entriesR   R   t
   all_assignt
   all_object(    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyt   _nose_tools_trivial_transform1   s    		s   nose.tools.trivialc         C   s   |  j  d k S(   Ns
   nose.tools(   R   (   t   n(    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyR   F   s    (   t   __doc__t   reR   R   t   astroid.buildert   buildert   AstroidBuildert   MANAGERR   t   compileR   R   R    R,   t   register_module_extendert   register_transformt   Module(    (    (    s7   lib/python2.7/site-packages/astroid/brain/brain_nose.pyt   <module>   s   			