Your IP : 216.73.216.213
9�8Vi
� @ sD d Z d d l Z d d l Z Gd d � d e � Z d d � Z d S)z
Provide the Reporter class.
� Nc @ sF e Z d Z d Z d d � Z d d � Z d d � Z d d � Z d
S)�Reporterz:
Formats the results of pyflakes checks to users.
c C s | | _ | | _ d S)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/python35/lib/python3.5/site-packages/pyflakes/reporter.py�__init__ s zReporter.__init__c C s | j j d | | f � d S)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� | j � d } | d k r] | t | � t | � } | j j d | | | d | f � n | j j d | | | f � | j j | � | j j d � | d k r� | j j t j d d | d | � � d � d S)
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'