Your IP : 216.73.216.213
B
9�8Vi
� @ s0 d Z ddlZddlZG dd� de�Zdd� ZdS )z
Provide the Reporter class.
� Nc @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )�Reporterz:
Formats the results of pyflakes checks to users.
c C s || _ || _dS )a�
Construct a L{Reporter}.
@param warningStream: A file-like object where warnings will be
written to. The stream's C{write} method must accept unicode.
C{sys.stdout} is a good value.
@param errorStream: A file-like object where error output will be
written to. The stream's C{write} method must accept unicode.
C{sys.stderr} is a good value.
N)�_stdout�_stderr)�selfZ
warningStreamZerrorStream� r �B/opt/alt/python37/lib/python3.7/site-packages/pyflakes/reporter.py�__init__ s zReporter.__init__c C s | j �d||f � dS )a
An unexpected error occurred trying to process C{filename}.
@param filename: The path to a file that we could not process.
@ptype filename: C{unicode}
@param msg: A message explaining the problem.
@ptype msg: C{unicode}
z%s: %s
N)r �write)r �filename�msgr r r �unexpectedError s zReporter.unexpectedErrorc C s� |� � d }|dk rF|t|�t|� }| j�d|||d |f � n| j�d|||f � | j�|� | j�d� |dk r�| j�t�dd|d|� �d � dS )
a0
There was a syntax error in C{filename}.
@param filename: The path to the file with the syntax error.
@ptype filename: C{unicode}
@param msg: An explanation of the syntax error.
@ptype msg: C{unicode}
@param lineno: The line number where the syntax error occurred.
@ptype lineno: C{int}
@param offset: The column on which the syntax error occurred, or None.
@ptype offset: C{int}
@param text: The source code containing the syntax error.
@ptype text: C{unicode}
���Nz
%s:%d:%d: %s
� z
%s:%d: %s
�
z\S� z^
)�
splitlines�lenr r �re�sub)r r
r �lineno�offset�text�liner r r �syntaxError'