Your IP : 216.73.216.213
�
�mYc @` s% d d l m Z m Z m Z m Z d d l m Z d d l Z d d l Z d d l Z d d l
Z
e Z y d d l
Z
d d l
m Z Wn e k
r� d Z d Z
n Xd e f d � � YZ d d e j d d � Z d � Z d
� Z d � Z d d � Z d
� Z e d d � Z e d � Z d S( i ( t absolute_importt divisiont
generatorst print_function( t bisect_rightN( t
PyCF_ONLY_ASTt Sourcec B` s� e Z d Z d Z d � Z d � Z d Z d � Z d � Z d � Z
d d d d
� Z d d � Z e
d � Z e
d
� Z d d � Z e d � Z d � Z d d e j d d d � Z RS( sY a immutable object holding a source code fragment,
possibly deindenting it.
i c O` s< g | _ } | j d t � } | j d t � } x| D]� } | sM g } n t | t � rh | j } n� t | t t f � r� g | D] } | j d � ^ q� } np t | t j j
� r� | j d � } | rx+ | r� | d j � r� Pn | j
� q� Wqn t | d | �j } | r't | � } n | j | � q8 Wd S( Nt deindentt rstrips
i����( t linest gett Truet
isinstanceR t tuplet listR t pyt builtint _basestringt splitt stript popt getsourceR t extend( t selft partst kwargsR t deR t partt partlinest x( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyt __init__ s*
% c C` sL y | j | j k SWn1 t k
rG t | t � rC t | � | k St SXd S( N( R t AttributeErrorR t strt False( R t other( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyt __eq__. s
c C` sb t | t � r | j | S| j d k r8 t d � � n t � } | j | j | j !| _ | Sd S( Ni s! cannot slice a Source with a step( Ni ( R t intR t stept Nonet
IndexErrorR t startt stop( R t keyt newsource( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyt __getitem__8 s c C` s
t | j � S( N( t lenR ( R ( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyt __len__B s c C` s� d t | � } } x. | | k rC | j | j � rC | d 7} q Wx2 | | k rx | j | d j � rx | d 8} qG Wt � } | j | | !| j (| S( s] return new source object with trailing
and leading blank lines removed.
i i ( R- R R R ( R R( t endt source( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyR E s #' t t i c C` s\ t | � } t | � } t � } g | j D] } | | ^ q+ } | j | | j | _ | S( se return a copy of the source object with
'before' and 'after' wrapped around it.
( R R ( R t beforet aftert indentR+ t lineR ( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyt putaroundR s c C` s0 t � } g | j D] } | | ^ q | _ | S( sl return a copy of the source object with
all lines indented by the given indent-string.
( R R ( R R5 R+ R6 ( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyR5 ] s #c C` s# | j | | � \ } } | | | !S( sc return Source statement which contains the
given linenumber (counted from 0).
( t getstatementrange( R t linenot assertionR( R/ ( ( sE /opt/alt/python27/lib/python2.7/site-packages/_pytest/_code/source.pyt getstatemente s c C` sS d | k o t | � k n s1 t d � � n t | | � \ } } } | | f S( s{ return (start, end) tuple which spans the minimal
statement region which containing the given lineno.
i s lineno out of range( R- R'