Ë
    V.jò0  ã                   ó(  — d Z ddlZddlZddlmZ ddlmZ  G d„ de«      Z G d„ de«      Zd	„ Z	 G d
„ de«      Z
 G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d«      Zdd„Zd„ Zd„ Zd„ Z e«        d„ Zy)zexception classesé    N)Úcompat)Úutilc                   ó   — e Zd Zy)ÚMakoExceptionN©Ú__name__Ú
__module__Ú__qualname__© ó    úQC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\mako/exceptions.pyr   r      ó   „ Ør   r   c                   ó   — e Zd Zy)ÚRuntimeExceptionNr   r   r   r   r   r      r   r   r   c                 ó$   — |€d| |fz  S d|| |fz  S )Nz at line: %d char: %dz" in file '%s' at line: %d char: %dr   )ÚlinenoÚposÚfilenames      r   Ú_format_fileposr      s)   € ØÐØ&¨&°#¨Ñ6Ð6à3°xÀÈÐ6MÑMÐMr   c                   ó   — e Zd Zd„ Zy)ÚCompileExceptionc           	      ó„   — t         j                  | |t        |||«      z   «       || _        || _        || _        || _        y ©N©r   Ú__init__r   r   r   r   Úsource©ÚselfÚmessager   r   r   r   s         r   r   zCompileException.__init__    óA   € Ü×ÑØ�'œO¨F°C¸ÓBÑBô	
ð ˆŒØˆŒØ ˆŒØˆ�r   N©r   r	   r
   r   r   r   r   r   r      ó   „ ór   r   c                   ó   — e Zd Zd„ Zy)ÚSyntaxExceptionc           	      ó„   — t         j                  | |t        |||«      z   «       || _        || _        || _        || _        y r   r   r   s         r   r   zSyntaxException.__init__+   r    r   Nr!   r   r   r   r$   r$   *   r"   r   r$   c                   ó   — e Zd ZdZy)ÚUnsupportedErrorz&raised when a retired feature is used.N©r   r	   r
   Ú__doc__r   r   r   r'   r'   5   s   „ â0r   r'   c                   ó   — e Zd ZdZy)ÚNameConflictErrorz3raised when a reserved word is used inappropriatelyNr(   r   r   r   r+   r+   :   s   „ â=r   r+   c                   ó   — e Zd Zy)ÚTemplateLookupExceptionNr   r   r   r   r-   r-   ?   r   r   r-   c                   ó   — e Zd Zy)ÚTopLevelLookupExceptionNr   r   r   r   r/   r/   C   r   r   r/   c                   ój   — e Zd ZdZdd„Zed„ «       Zd„ Zd„ Zed„ «       Z	ed„ «       Z
ed	„ «       Zd
„ Zy)ÚRichTracebackz«Pull the current exception from the ``sys`` traceback and extracts
    Mako-specific template information.

    See the usage examples in :ref:`handling_exceptions`.

    Nc                 ó†  — d\  | _         | _        |�|€t        j                  «       \  }}}|€xs }|€}|| _        | j                  |«      | _        t        | j                  t        t        f«      r=| j                  j                   | _         | j                  j                  | _        d| _
        | j                  «        y )N)Ú r   T)r   r   ÚsysÚexc_infoÚerrorÚ_initÚrecordsÚ
isinstancer   r$   Ú_has_sourceÚ_init_message)r   r6   Ú	tracebackÚtÚvalueÚtbacks         r   r   zRichTraceback.__init__P   s¥   € Ø#(Ñ ˆŒ�T”[àˆ=˜IÐ-Ü!Ÿl™l›n‰OˆAˆu�eàˆ=Ø’J˜QˆEàÐØˆIàˆŒ
Ø—z‘z )Ó,ˆŒä�d—j‘jÔ#3´_Ð"EÔFØŸ*™*×+Ñ+ˆDŒKØŸ*™*×+Ñ+ˆDŒKØ#ˆDÔà×ÑÕr   c                 ó@   — t        j                  | j                  «      S r   )r   Úexception_namer6   ©r   s    r   Ú	errornamezRichTraceback.errornamef   s   € ä×$Ñ$ T§Z¡ZÓ0Ð0r   c                 óX  — 	 t        | j                  «      | _        t        | j                  t         «      st        | j                  dd«      | _        yy# t        $ rL 	 t        | j                  «      | _        n-# t        $ r! | j                  j
                  d   | _        Y nw xY wY ŒŒw xY w)z+Find a unicode representation of self.errorr   ÚasciiÚreplaceN)Ústrr6   r   ÚUnicodeErrorÚUnicodeEncodeErrorÚargsr9   rB   s    r   r;   zRichTraceback._init_messagej   s‰   € ð	2Ü˜tŸz™z›?ˆDŒLô ˜$Ÿ,™,¬Ô,Ü˜tŸ|™|¨W°iÓ@ˆD�Lð -øô ò 	2ð2Ü" 4§:¡:›�•øÜ%ò 2ð  $Ÿz™zŸ™¨qÑ1�–ð2üð	2ús5   ‚A Á	B)ÁA9Á8B)Á9'B#Â B)Â"B#Â#B)Â(B)c              #   ón   K  — |D ],  }|d   �|d   |d   |d   |d   f–— Œt        |dd «      –— Œ. y ­w)Né   é   é   é   r   )Útuple)r   r8   Úrecs      r   Ú_get_reformatted_recordsz&RichTraceback._get_reformatted_recordsx   sI   è ø€ ÛˆCØ�1‰vÐ!Ø˜1‘v˜s 1™v s¨1¡v¨s°1©vÐ6Ó6ä˜C  !˜H“oÓ%ñ	 ùs   ‚35c                 óJ   — t        | j                  | j                  «      «      S )z¨Return a list of 4-tuple traceback records (i.e. normal python
        format) with template-corresponding lines remapped to the originating
        template.

        )ÚlistrR   r8   rB   s    r   r<   zRichTraceback.traceback   s   € ô �D×1Ñ1°$·,±,Ó?Ó@Ð@r   c                 ó,   — t        | j                  «      S r   )Úreversedr8   rB   s    r   Úreverse_recordszRichTraceback.reverse_recordsˆ   s   € ä˜Ÿ™Ó%Ð%r   c                 óJ   — t        | j                  | j                  «      «      S )z;Return the same data as traceback, except in reverse order.)rT   rR   rW   rB   s    r   Úreverse_tracebackzRichTraceback.reverse_tracebackŒ   s    € ô �D×1Ñ1°$×2FÑ2FÓGÓHÐHr   c                 ó¸  — ddl }i }t        j                  |«      }g }|D ]O  \  }}}}	|	sd}		 ||   \  }
}}|
|dz
     }|t        |«      k  r	||dz
     }nd}|j                  ||||	|||f«       ŒQ | j                  sÏt        t        |«      dz
  dd	«      D ]'  }||   d
   sŒ||   d   | _        ||   d
   | _         |S  |rŠ	 t#        |d	   d   d«      5 }t%        j&                  |«      }|sd}|j)                  d«       |j+                  «       | _        ddd«       r | j                  j-                  |«      | _        |d	   d   | _        |S # t        $ rÝ 	 |j                  j                  |«      }|j                  }|j                  }|j                  xs |j                  xs |}n*# t        $ r |j                  ||||	ddddf«       Y Y �Œ±w xY wd}|j                  j                  }|j                  |d¬«      }|d   }
|j                  d«      D �cg c]  }|‘Œ nc c}w }}|
||f||<   Y �Œþw xY w# 1 sw Y   �Œ$xY w# t.        $ r d| _        Y �Œw xY w)a  format a traceback from sys.exc_info() into 7-item tuples,
        containing the regular four traceback tuple items, plus the original
        template filename, the line number adjusted relative to the template
        source, and code line from that line number of the template.r   Nr3   é   T)Úfull_line_mapr\   Ú
éÿÿÿÿrN   é   Úrbzutf-8)Úmako.templater<   Ú
extract_tbÚKeyErrorÚtemplateÚ_get_module_infoÚcoder   Útemplate_filenameÚtemplate_uriÚappendÚ
ModuleInfoÚget_module_source_metadataÚsplitÚlenÚranger   Úopenr   Úparse_encodingÚseekÚreadÚdecodeÚIOError)r   ÚtrcbackÚmakoÚmodsÚ
rawrecordsÚnew_trcbackr   r   ÚfunctionÚlineÚline_mapÚtemplate_linesrg   ÚinfoÚmodule_sourceÚtemplate_sourceÚtemplate_lnÚmtmÚ
source_mapÚline_Útemplate_lineÚlÚfpÚencodings                           r   r7   zRichTraceback._init’   sÐ  € ó 	àˆÜ×)Ñ)¨'Ó2ˆ
ØˆÛ0:Ñ,ˆH�f˜h¨ÙØ�ð%OØ@DÀXÁÑ=�˜>Ð+<ðL # 6¨A¡:Ñ.ˆKàœc .Ó1Ò1Ø .¨{¸Q©Ñ ?‘à $�Ø×ÑàØØØØ%ØØ!Ø#ð	õða 1;ðx �{Š{Üœ3˜{Ó+¨aÑ/°°BÖ7�Ø˜q‘> !Ó$Ø"-¨a¡.°Ñ"3�D”KØ"-¨a¡.°Ñ"3�D”KØð  Ðð) 8ñ ð)ä! +¨b¡/°!Ñ"4°dÔ;¸rÜ'+×':Ñ':¸2Ó'>˜HÙ#+Ø+2 ØŸG™G AœJØ*,¯'©'«)˜DœK÷ <ñ $Ø*.¯+©+×*<Ñ*<¸XÓ*F˜DœKð #.¨b¡/°!Ñ"4�D”KØÐøôY ò #OðØŸ=™=×9Ñ9¸(ÓC�DØ$(§I¡I�MØ&*§k¡k�Oà×.Ñ.ÒO°$×2CÑ2CÒOÀxñ &øô  ò à×&Ñ&à$Ø"Ø$Ø Ø Ø Ø Ø ð	ôó ðúð   �à—m‘m×.Ñ.�Ø ×;Ñ;Ø!°ð <ó �
ð & oÑ6�ð (7×'<Ñ'<¸TÔ'Bó"Ù'B˜e’EÑ'Bùò"�ð "ð #+¨NÐ<MÐ!N��X”ðG#Oú÷B <Ñ;ûô #ò )Ø&(˜Ÿð)úsn   ­	EÃI ÃA H8Ä*I Å	H5ÅAF+Æ*H5Æ+"GÇH5ÇGÇAH5È	H"È!H5È4H5È8IÈ=I ÉIÉI)NN)r   r	   r
   r)   r   ÚpropertyrC   r;   rR   r<   rW   rY   r7   r   r   r   r1   r1   G   sq   „ ñóð, ñ1ó ð1òAò&ð ñAó ðAð ñ&ó ð&ð ñIó ðIó
\r   r1   c                 ó@   — ddl }|j                  j                  d«      S )zéProvides a template that renders a stack trace in a similar format to
    the Python interpreter, substituting source template filenames, line
    numbers and code for that of the originating source template, as
    applicable.

    r   Na‚  
<%page args="error=None, traceback=None"/>
<%!
    from mako.exceptions import RichTraceback
%>\
<%
    tback = RichTraceback(error=error, traceback=traceback)
%>\
Traceback (most recent call last):
% for (filename, lineno, function, line) in tback.traceback:
  File "${filename}", line ${lineno}, in ${function or '?'}
    ${line | trim}
% endfor
${tback.errorname}: ${tback.message}
)ra   rd   ÚTemplate)Úlookuprv   s     r   Útext_error_templater�   ñ   s#   € ó à�=‰=×!Ñ!ð	óð r   c                  ó   — ddl ma ddl ma y )Nr   )Úsyntax_highlight)Úpygments_html_formatter)Úmako.ext.pygmentpluginr�   r�   r   r   r   Ú_install_pygmentsr’     s   € å7Þ>r   c                  ó"   ‡ — ddl mŠ  d adˆ fd„	ay )Nr   ©Úhtml_escapec                 ó   •— ‰S r   r   )r   Úlanguager•   s     €r   r�   r�     s	   ø€ ØÐr   )r3   N)Úmako.filtersr•   r�   r�   r”   s   @r   Ú_install_fallbackr™     s   ø€ å(à"Ðör   c                  óL   — 	 t        «        y # t        $ r t        «        Y y w xY wr   )r’   ÚImportErrorr™   r   r   r   Ú_install_highlightingrœ     s"   € ðÜÕøÜò ÜÖðús   ‚
 �#¢#c                  ój   — ddl } | j                  j                  dt        j                  «       d¬«      S )a  Provides a template that renders a stack trace in an HTML format,
    providing an excerpt of code as well as substituting source template
    filenames, line numbers and code for that of the originating source
    template, as applicable.

    The template's default ``encoding_errors`` value is
    ``'htmlentityreplace'``. The template has two options. With the
    ``full`` option disabled, only a section of an HTML document is
    returned. With the ``css`` option disabled, the default stylesheet
    won't be included.

    r   Naá  
<%!
    from mako.exceptions import RichTraceback, syntax_highlight,\
            pygments_html_formatter
%>
<%page args="full=True, css=True, error=None, traceback=None"/>
% if full:
<html>
<head>
    <title>Mako Runtime Error</title>
% endif
% if css:
    <style>
        body { font-family:verdana; margin:10px 30px 10px 30px;}
        .stacktrace { margin:5px 5px 5px 5px; }
        .highlight { padding:0px 10px 0px 10px; background-color:#9F9FDF; }
        .nonhighlight { padding:0px; background-color:#DFDFDF; }
        .sample { padding:10px; margin:10px 10px 10px 10px;
                  font-family:monospace; }
        .sampleline { padding:0px 10px 0px 10px; }
        .sourceline { margin:5px 5px 10px 5px; font-family:monospace;}
        .location { font-size:80%; }
        .highlight { white-space:pre; }
        .sampleline { white-space:pre; }

    % if pygments_html_formatter:
        ${pygments_html_formatter.get_style_defs()}
        .linenos { min-width: 2.5em; text-align: right; }
        pre { margin: 0; }
        .syntax-highlighted { padding: 0 10px; }
        .syntax-highlightedtable { border-spacing: 1px; }
        .nonhighlight { border-top: 1px solid #DFDFDF;
                        border-bottom: 1px solid #DFDFDF; }
        .stacktrace .nonhighlight { margin: 5px 15px 10px; }
        .sourceline { margin: 0 0; font-family:monospace; }
        .code { background-color: #F8F8F8; width: 100%; }
        .error .code { background-color: #FFBDBD; }
        .error .syntax-highlighted { background-color: #FFBDBD; }
    % endif

    </style>
% endif
% if full:
</head>
<body>
% endif

<h2>Error !</h2>
<%
    tback = RichTraceback(error=error, traceback=traceback)
    src = tback.source
    line = tback.lineno
    if src:
        lines = src.split('\n')
    else:
        lines = None
%>
<h3>${tback.errorname}: ${tback.message|h}</h3>

% if lines:
    <div class="sample">
    <div class="nonhighlight">
% for index in range(max(0, line-4),min(len(lines), line+5)):
    <%
       if pygments_html_formatter:
           pygments_html_formatter.linenostart = index + 1
    %>
    % if index + 1 == line:
    <%
       if pygments_html_formatter:
           old_cssclass = pygments_html_formatter.cssclass
           pygments_html_formatter.cssclass = 'error ' + old_cssclass
    %>
        ${lines[index] | syntax_highlight(language='mako')}
    <%
       if pygments_html_formatter:
           pygments_html_formatter.cssclass = old_cssclass
    %>
    % else:
        ${lines[index] | syntax_highlight(language='mako')}
    % endif
% endfor
    </div>
    </div>
% endif

<div class="stacktrace">
% for (filename, lineno, function, line) in tback.reverse_traceback:
    <div class="location">${filename}, line ${lineno}:</div>
    <div class="nonhighlight">
    <%
       if pygments_html_formatter:
           pygments_html_formatter.linenostart = lineno
    %>
      <div class="sourceline">${line | syntax_highlight(filename)}</div>
    </div>
% endfor
</div>

% if full:
</body>
</html>
% endif
Úhtmlentityreplace)Úoutput_encodingÚencoding_errors)ra   rd   r‹   r4   Úgetdefaultencoding)rv   s    r   Úhtml_error_templater¢   '  s>   € ó à�=‰=×!Ñ!ðg	ôP ×.Ñ.Ó0Ø+ðU "ó kð kr   r   )r)   r4   r<   rv   r   r   Ú	Exceptionr   r   r   r   r$   r'   r+   r-   r/   r1   r�   r’   r™   rœ   r¢   r   r   r   Ú<module>r¤      s¬   ðñ ã 
Û å Ý ô	�Iô 	ô	�}ô 	òNô�}ô ô�mô ô1�}ô 1ô
>˜ô >ô
	˜mô 	ô	Ð5ô 	÷gñ góTò8?òòñ Ô ózr   