qBFjDddlZddlZddlZddlZddlmZddlmZddl m Z m Z ddl m Z mZmZddlmZmZmZmZmZmZddlmZejeZGdd ZdS) N)Counter)escape) FrameType TracebackType)UnionIterableList)style_with_executing_nodeOptionsLine FrameInfoVariableRepeatedFrames)some_strcDeZdZdddddddddddddd dZddeefd Zd edefd Zddeefd Z d e e e e fde efdZde defdZde e eefdefdZdZdedefdZde de efdZdedefdZdZdefdZde defdZdS) SerializerNFTmonokaiz bg:#005080) options pygmentedshow_executing_nodepygments_formatter_clspygments_formatter_kwargspygments_styleexecuting_node_modifieruse_code_qualnamestrip_leading_indenthtmlchaincollapse_repeated_framesshow_variablesc |t}|r;|js4|rt||}|| rddlm}nddlm}|dd|i|pi|_||_||_| |_ | |_ | |_ ||_ | |_ | |_dS)Nr) HtmlFormatter)Terminal256Formatterstyle)r pygments_formatterr pygments.formatters.htmlr"pygments.formatters.terminal256r#rrrrrrrr )selfrrrrrrrrrrrrr s DC:\PYTHON\_runtimes\venv\Lib\site-packages\stack_data/serializing.py__init__zSerializer.__init__s" ?iiG  W7 " !:"$;""&-*@)?**$*+1r**G & #!2$8!   (@%,returnc|tjd}g}|jr|jB||j}t j|dd<nO|jH|j sA||j}t j |dd<| | ||S)Ntail) sysexc_infor __cause__format_exception traceback_cause_messagestrip __context____suppress_context___context_messageappendformat_traceback_part)r)eresults r*r5zSerializer.format_exceptionJs 9 q!A : H{&..q{;;%.%=%C%C%E%Er 6""*13I*..q}==%.%?%E%E%G%Gr 6" d0033444 r,r>c t||jptjdtt |jt|dS)N)typemessage)frames exceptionr1)dict format_stack __traceback__r2r3rB__name__r)r)r>s r*r=z Serializer.format_traceback_part[sh$$Q_%I q8IJJ!WW%       r,c |tjj}t|t j||j|jS)N)r) inspect currentframef_backlistformat_stack_datar stack_datarr)r) frame_or_tbs r*rHzSerializer.format_stackesa  !.007K  " "$L-1-J     r,stackc#K|D]t}t|tr:||s-tdddi||VQtdddi||VudS)NrBframerepeated_framesr%) isinstancer should_include_framerG format_frameformat_repeated_frames)r)rSitems r*rPzSerializer.format_stack_datass X XD$ ** X0066CCC4+<+z3Serializer.format_repeated_frames..stAwhQ (:;r,keycHg|]\\}}}t|j|| S))namelinenocount)rGr^).0coderdres r* z5Serializer.format_repeated_frames..sL *NT6E !r,)rE)sortedr frame_keysitemsrG)r)rVcountss r*rZz!Serializer.format_repeated_frames~sm O. / / 5 5 7 7;;    .4     r,rUc t|tst||j}t|jr|jn |jj|j |j t| |j }|jr%t|||d<|S)N)rcfilenamerdlines variables)rWr rrGr executing code_qualnamergr^rnrdrO format_linesror format_variables)r)rUr?s r*rYzSerializer.format_frames%++ 3eT\22E)(--///Z'^<t((5566       E"&t'<'    r, frame_infoc#K t|jdD]}||VdS#t$rtdYdSwxYw)Nc|jSN)rc)vs r*r_z-Serializer.format_variables..s!&r,r`z Error in getting frame variables)rirpformat_variable ExceptionlogrF)r)r~vars r*rtzSerializer.format_variabless >j28H8HIII 0 0**3////// 0 0 > > > MM< = = = = = = >s17$AArct||j|||jS)N)rcvalue)rGformat_variable_partrcformat_variable_valuer)r)rs r*rzSerializer.format_variablesM**3844++D,F,Fsy,Q,QRR    r,c2|jrt|S|Sr)rrz)r)r|s r*rzSerializer.format_variable_parts 9 t$$ $Kr,c t|Sr)repr)r)rs r*rz Serializer.format_variable_valuesE{{r,cdS)NTr%)r)r~s r*rXzSerializer.should_include_framestr,r)rJ __module__ __qualname__r+r rGr5 BaseExceptionr=rHrrr rrPrZrrrYrsr rxrtrrrstrrboolrXr%r,r*rrs #"& ,! !%0-0-0-0-0-d$t*" }        T      XeI~$=>? X $ X X X X n     % 9m(K"LQU$,,,         >9>$>>>> 8      cyTr,r)rLloggingr2r6 collectionsrrrrztypesrrtypingrrr rQr r r r rrstack_data.utilsr getLoggerrJrrr%r,r*rs8 &&&&&&********((((((((((&%%%%%g!!rrrrrrrrrrr,