Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/pyflakes/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/pyflakes/__pycache__/reporter.cpython-35.pyc



9�8Vi
�@sDdZddlZddlZGdd�de�Zdd�ZdS)z
Provide the Reporter class.
�Nc@sFeZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Reporterz:
    Formats the results of pyflakes checks to users.
    cCs||_||_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/python35/lib/python3.5/site-packages/pyflakes/reporter.py�__init__s	zReporter.__init__cCs|jjd||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�msgrrr�unexpectedErrors	zReporter.unexpectedErrorcCs�|j�d	}|dk	r]|t|�t|�}|jjd|||d|f�n|jjd|||f�|jj|�|jjd�|dk	r�|jjtjdd|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�lenrr	�re�sub)rr
r�lineno�offset�text�linerrr�syntaxError's%zReporter.syntaxErrorcCs*|jjt|��|jjd�dS)zp
        pyflakes found something wrong with the code.

        @param: A L{pyflakes.messages.Message}.
        rN)rr	�str)r�messagerrr�flakeCszReporter.flakeN)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr	s
rcCsttjtj�S)zI
    Make a reporter that can be used when no reporter is specified.
    )r�sys�stdout�stderrrrrr�_makeDefaultReporterMsr$)r rr!�objectrr$rrrr�<module>sD