Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/pyflakes/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/pyflakes/__pycache__/reporter.cpython-37.opt-1.pyc

B

9�8Vi
�@s0dZddlZddlZGdd�de�Zdd�ZdS)z
Provide the Reporter class.
�Nc@s0eZdZdZdd�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/python37/lib/python3.7/site-packages/pyflakes/reporter.py�__init__szReporter.__init__cCs|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�msgrrr�unexpectedErrors	zReporter.unexpectedErrorc	Cs�|��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�lenrr	�re�sub)rr
r�lineno�offset�text�linerrr�syntaxError'szReporter.syntaxErrorcCs |j�t|��|j�d�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>sD