ó
3VœNc           @   s„   d  d l  Z  d  d l Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 d d d „ Z
 d	 e j f d
 „  ƒ  YZ d S(   iÿÿÿÿN(   t   path(   t   unittest(   t   reflect(   t	   getModulei   t    c         C   s   d |  | | f S(   sÊ   
    Return a filename formatted so emacs will recognize it as an error point

    @param line: Line number in file.  Defaults to 17 because that's about how
        long the copyright headers are.
    s   %s:%d:%s(    (   t   ft   linet   name(    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyt   errorInFile   s    t   DocCoveragec           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d e _ RS(   s=   
    Looking for docstrings in all modules and packages.
    c         C   sL   g  |  _  x< t d ƒ j ƒ  D]( } | j ƒ  r |  j  j | j ƒ q q Wd  S(   Nt   twisted(   t   packageNamesR   t   walkModulest	   isPackaget   appendR   (   t   selft   mod(    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyt   setUp   s    	c         C   s›   g  } xe |  j  D]Z } | d k r( q n  y t j | ƒ } Wn t k
 rP } q X| j |  j | | ƒ ƒ q W|  j | d d j t t	 | ƒ ƒ f ƒ d S(   s8   
        Looking for docstrings in all modules.
        s   twisted.tests!   No docstrings in module files:
%ss   
N(   s   twisted.test(
   R   R   t   namedModulet   ImportErrort   extendt   modulesInPackaget   failIft   joint   mapR   (   R   t   doclesst   packageNamet   packaget   e(    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyt   testModules#   s    c   	      C   sÌ   g  } t  j | j ƒ } x­ t j t  j | d ƒ ƒ D] } t j | ƒ } | d k r[ q4 n | d k rm q4 n  y" t j d j | | g ƒ ƒ } Wn t	 k
 r¤ } q4 Xt j
 | ƒ s4 | j | ƒ q4 q4 W| S(   Ns   *.pyt   __init__t   spelunk_gnomet
   gtkmanholet   .(   R   R    (   R    t   dirnamet   __file__t   globR   t   inspectt   getmodulenameR   R   t	   Exceptiont   getdocR   (	   R   R   R   R   t	   directoryt   modfilet
   moduleNamet   moduleR   (    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyR   :   s     "c         C   s›   g  } xh |  j  D]] } y t j | ƒ } Wn t k
 r> } q Xt j | ƒ s | j | j j d d ƒ ƒ q q W|  j	 | d d j
 t t | ƒ ƒ ƒ d S(   s9   
        Looking for docstrings in all packages.
        s   .pycs   .pys"   No docstrings for package files
%ss   
N(   R   R   R   R'   R%   R(   R   R#   t   replaceR   R   R   R   (   R   R   R   R   R   (    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyt   testPackagesR   s    #sP   Activate me when you feel like writing docstrings, and fixing GTK crashing bugs.(   t   __name__t
   __module__t   __doc__R   R   R   R.   t   skip(    (    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyR	      s   				(   R%   R$   t   osR    t   twisted.trialR   t   twisted.pythonR   t   twisted.python.modulesR   R   t   TestCaseR	   (    (    (    s9   /usr/lib/python2.7/dist-packages/twisted/test/test_doc.pyt   <module>   s   