3
^^                 @   s"   d dl Z d dlZG dd dZdS )    Nc               @   sb   e Zd ZdZdZdddZdd Zddd	Zdd
dZdd Z	dd Z
dd Zdd Zdd ZdS )BaseReporterzSbase class for reporters

    symbols: show short symbolic names for messages.
     Nc             C   s6   d | _ d| _d | _d | _| j| tj tj | _d S )Nr   )	ZlintersectionoutZout_encoding
set_outputosgetcwdsepZpath_strip_prefix)selfoutput r   @/tmp/pip-build-8app2_gc/pylint/pylint/reporters/base_reporter.py__init__   s    
zBaseReporter.__init__c             C   s   dS )z3Handle a new message triggered on the current file.Nr   )r
   msgr   r   r   handle_message   s    zBaseReporter.handle_messagec             C   s   |pt j| _dS )zset output streamN)sysstdoutr   )r
   r   r   r   r   r      s    zBaseReporter.set_outputc             C   s   t || jd dS )z!write a line in the output buffer)fileN)printr   )r
   stringr   r   r   writeln"   s    zBaseReporter.writelnc             C   s>   d| _ t|dr0|jd jd  jd|j 7  _| j| dS )z/display results encapsulated in the layout treer   	report_idz (%s)N)r   hasattrchildrendatar   _display)r
   layoutr   r   r   display_reports&   s    
 zBaseReporter.display_reportsc             C   s
   t  dS )zdisplay the layoutN)NotImplementedError)r
   r   r   r   r   r   -   s    zBaseReporter._displayc             C   s   dS )a  Hook for displaying the messages of the reporter

        This will be called whenever the underlying messages
        needs to be displayed. For some reporters, it probably
        doesn't make sense to display messages as soon as they
        are available, so some mechanism of storing them could be used.
        This method can be implemented to display them after they've
        been aggregated.
        Nr   )r
   r   r   r   r   display_messages1   s    zBaseReporter.display_messagesc             C   s   dS )z0Hook called when a module starts to be analysed.Nr   )r
   modulefilepathr   r   r   on_set_current_module>   s    z"BaseReporter.on_set_current_modulec             C   s   dS )z-Hook called when a module finished analyzing.Nr   )r
   statsZprevious_statsr   r   r   on_closeA   s    zBaseReporter.on_close)N)N)r   )__name__
__module____qualname____doc__	extensionr   r   r   r   r   r   r   r"   r$   r   r   r   r   r   
   s   
	

r   )r   r   r   r   r   r   r   <module>   s   