K i 2dZddlZddlZGddZdZy)z Provide the Reporter class. Nc(eZdZdZdZdZdZdZy)Reporterz: Formats the results of pyflakes checks to users. c ||_||_y)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)self warningStream errorStreams W/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pyflakes/reporter.py__init__zReporter.__init__s% " cF|jj|d|dy)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:  N)rwrite)rfilenamemsgs r unexpectedErrorzReporter.unexpectedErrors# hZr#b12r c |d}n|jd}t|xsdd}|/t|d}|jjd||||fzn!|jjd|||fz|s|jj||jjd|:|jjt j dd |d|dz d zyyy) 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} Nrz %s:%d:%d: %s z %s:%d: %s rz\S z^ ) splitlinesmaxrrresub)rrrlinenooffsettextlines r syntaxErrorzReporter.syntaxError's <D??$R(DV[q!$  ^F LL  / (&&#> ? @ LL  }&#/FF G   LL  t $ LL  t $! ""266%d;FQJ6G#H#($)*" r c|jjt||jjdy)zp pyflakes found something wrong with the code. @param: A L{pyflakes.messages.Message}. rN)rrstr)rmessages r flakezReporter.flakeNs, 3w<( 4 r N)__name__ __module__ __qualname____doc__r rr r$r r rr s # 3%*N!r rcRttjtjS)zI Make a reporter that can be used when no reporter is specified. )rsysstdoutstderrr)r r _makeDefaultReporterr.Xs CJJ ++r )r(rr+rr.r)r r r/s$ L!L!^,r