Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
html.cpython-313.pyc479 linesDownload Raw Back to __pycache__
1�

2�jՌ��:�SrSSKrSSKrSSKrSSKrSSKJr SSKJr SSK	J3r4JrJr SSK
JrJrJr SSKrSSKrS/r\"S5S	\"S55S\"S5S
\"S5S\"S5S0r\4SjrSrSrSrS\-S-rSrSr"SS\5rg!\a SrN]f=f)z�6pygments.formatters.html7~~~~~~~~~~~~~~~~~~~~~~~~8 9Formatter for HTML output.10 11:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.12:license: BSD, see LICENSE for details.13�N)�StringIO)�	Formatter)�Token�Text�STANDARD_TYPES)�get_bool_opt�get_int_opt�get_list_opt�
HtmlFormatter�&z&amp;�<z&lt;�>z&gt;�"z&quot;�'z&#39;c�$�URU5$)z<Escape &, <, > as well as single and double quotes for HTML.)�	translate)�text�tables  �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\pygments/formatters/html.py�escape_htmlr(s���>�>�%� � �c��URS5(dURS5(aU$UR5n[U5S:Xa6USUS:Xa*USUS:XaUSUS	:XaS14USUSUS3$S15U3$)N�calc�var�r������#)�16startswith�upper�len)�colors r�webifyr&-s���������5�#3�#3�E�#:�#:������
����J�!�O��q��U�1�X�%��q��U�1�X�%��q��U�1�X�%��u�Q�x�j��q��17�5��8�*�5�5��u�g�;�rc��[R"U5nU(aU$SnUc2SUS-U-nURn[R"U5nUcM2X-$)N��-�����)r�get�parent)�ttype�fname�anames   r�_get_ttype_classr0<s`�����u�%�E�����E�18�-��e�B�i��%�'�������"�"�5�)���-��=�rz�/*19generated by Pygments <https://pygments.org/>20Copyright 2006-present by the Pygments team.21Licensed under the BSD license, see LICENSE for details.22*/23%(styledefs)s24a�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"25   "http://www.w3.org/TR/html4/strict.dtd">26<!--27generated by Pygments <https://pygments.org/>28Copyright 2006-present by the Pygments team.29Licensed under the BSD license, see LICENSE for details.30-->31<html>32<head>33  <title>%(title)s</title>34  <meta http-equiv="content-type" content="text/html; charset=%(encoding)s">35  <style type="text/css">36z/37  </style>38</head>39<body>40<h2>%(title)s</h2>41 42a5<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"43   "http://www.w3.org/TR/html4/strict.dtd">44 45<html>46<head>47  <title>%(title)s</title>48  <meta http-equiv="content-type" content="text/html; charset=%(encoding)s">49  <link rel="stylesheet" href="%(cssfile)s" type="text/css">50</head>51<body>52<h2>%(title)s</h2>53 54z</body>55</html>56c�"�\rSrSrSrSrS/rSS/rSrSr	S	r57S58rSrS'S
jr
S'SjrS'SjrSrSr\S5r\S5r\S5rSrSrSrSrSrSrSrSrSr\R@"SS9S 5r!S!r"S"r#S#r$S$r%S%r&S&r'g)(r�{a:)59Format tokens as HTML 4 ``<span>`` tags. By default, the content is enclosed60in a ``<pre>`` tag, itself wrapped in a ``<div>`` tag (but see the `nowrap` option).61The ``<div>``'s CSS class can be set by the `cssclass` option.62 63If the `linenos` option is set to ``"table"``, the ``<pre>`` is64additionally wrapped inside a ``<table>`` which has one row and two65cells: one containing the line numbers and one containing the code.66Example:67 68.. sourcecode:: html69 70    <div class="highlight" >71    <table><tr>72      <td class="linenos" title="click to toggle"73        onclick="with (this.firstChild.style)74                 { display = (display == '') ? 'none' : '' }">75        <pre>176        2</pre>77      </td>78      <td class="code">79        <pre><span class="Ke">def </span><span class="NaFu">foo</span>(bar):80          <span class="Ke">pass</span>81        </pre>82      </td>83    </tr></table></div>84 85(whitespace added to improve clarity).86 87A list of lines can be specified using the `hl_lines` option to make these88lines highlighted (as of Pygments 0.11).89 90With the `full` option, a complete HTML 4 document is output, including91the style definitions inside a ``<style>`` tag, or in a separate file if92the `cssfile` option is given.93 94When `tagsfile` is set to the path of a ctags index file, it is used to95generate hyperlinks from names to their definition.  You must enable96`lineanchors` and run ctags with the `-n` option for this to work.  The97`python-ctags` module from PyPI must be installed to use this feature;98otherwise a `RuntimeError` will be raised.99 100The `get_style_defs(arg='')` method of a `HtmlFormatter` returns a string101containing CSS rules for the CSS classes used by the formatter. The102argument `arg` can be used to specify additional CSS selectors that103are prepended to the classes. A call `fmter.get_style_defs('td .code')`104would result in the following CSS classes:105 106.. sourcecode:: css107 108    td .code .kw { font-weight: bold; color: #00FF00 }109    td .code .cm { color: #999999 }110    ...111 112If you have Pygments 0.6 or higher, you can also pass a list or tuple to the113`get_style_defs()` method to request multiple prefixes for the tokens:114 115.. sourcecode:: python116 117    formatter.get_style_defs(['div.syntax pre', 'pre.syntax'])118 119The output would then look like this:120 121.. sourcecode:: css122 123    div.syntax pre .kw,124    pre.syntax .kw { font-weight: bold; color: #00FF00 }125    div.syntax pre .cm,126    pre.syntax .cm { color: #999999 }127    ...128 129Additional options accepted:130 131`nowrap`132    If set to ``True``, don't add a ``<pre>`` and a ``<div>`` tag133    around the tokens. This disables most other options (default: ``False``).134 135`full`136    Tells the formatter to output a "full" document, i.e. a complete137    self-contained document (default: ``False``).138 139`title`140    If `full` is true, the title that should be used to caption the141    document (default: ``''``).142 143`style`144    The style to use, can be a string or a Style subclass (default:145    ``'default'``). This option has no effect if the `cssfile`146    and `noclobber_cssfile` option are given and the file specified in147    `cssfile` exists.148 149`noclasses`150    If set to true, token ``<span>`` tags (as well as line number elements)151    will not use CSS classes, but inline styles. This is not recommended152    for larger pieces of code since it increases output size by quite a bit153    (default: ``False``).154 155`classprefix`156    Since the token types use relatively short class names, they may clash157    with some of your own class names. In this case you can use the158    `classprefix` option to give a string to prepend to all Pygments-generated159    CSS class names for token types.160    Note that this option also affects the output of `get_style_defs()`.161 162`cssclass`163    CSS class for the wrapping ``<div>`` tag (default: ``'highlight'``).164    If you set this option, the default selector for `get_style_defs()`165    will be this class.166 167    .. versionadded:: 0.9168       If you select the ``'table'`` line numbers, the wrapping table will169       have a CSS class of this string plus ``'table'``, the default is170       accordingly ``'highlighttable'``.171 172`cssstyles`173    Inline CSS styles for the wrapping ``<div>`` tag (default: ``''``).174 175`prestyles`176    Inline CSS styles for the ``<pre>`` tag (default: ``''``).177 178    .. versionadded:: 0.11179 180`cssfile`181    If the `full` option is true and this option is given, it must be the182    name of an external file. If the filename does not include an absolute183    path, the file's path will be assumed to be relative to the main output184    file's path, if the latter can be found. The stylesheet is then written185    to this file instead of the HTML file.186 187    .. versionadded:: 0.6188 189`noclobber_cssfile`190    If `cssfile` is given and the specified file exists, the css file will191    not be overwritten. This allows the use of the `full` option in192    combination with a user specified css file. Default is ``False``.193 194    .. versionadded:: 1.1195 196`linenos`197    If set to ``'table'``, output line numbers as a table with two cells,198    one containing the line numbers, the other the whole code.  This is199    copy-and-paste-friendly, but may cause alignment problems with some200    browsers or fonts.  If set to ``'inline'``, the line numbers will be201    integrated in the ``<pre>`` tag that contains the code (that setting202    is *new in Pygments 0.8*).203 204    For compatibility with Pygments 0.7 and earlier, every true value205    except ``'inline'`` means the same as ``'table'`` (in particular, that206    means also ``True``).207 208    The default value is ``False``, which means no line numbers at all.209 210    **Note:** with the default ("table") line number mechanism, the line211    numbers and code can have different line heights in Internet Explorer212    unless you give the enclosing ``<pre>`` tags an explicit ``line-height``213    CSS property (you get the default line spacing with ``line-height:214    125%``).215 216`hl_lines`217    Specify a list of lines to be highlighted. The line numbers are always218    relative to the input (i.e. the first line is line 1) and are219    independent of `linenostart`.220 221    .. versionadded:: 0.11222 223`linenostart`224    The line number for the first line (default: ``1``).225 226`linenostep`227    If set to a number n > 1, only every nth line number is printed.228 229`linenospecial`230    If set to a number n > 0, every nth line number is given the CSS231    class ``"special"`` (default: ``0``).232 233`nobackground`234    If set to ``True``, the formatter won't output the background color235    for the wrapping element (this automatically defaults to ``False``236    when there is no wrapping element [eg: no argument for the237    `get_syntax_defs` method given]) (default: ``False``).238 239    .. versionadded:: 0.6240 241`lineseparator`242    This string is output between lines of code. It defaults to ``"\n"``,243    which is enough to break a line inside ``<pre>`` tags, but you can244    e.g. set it to ``"<br>"`` to get HTML line breaks.245 246    .. versionadded:: 0.7247 248`lineanchors`249    If set to a nonempty string, e.g. ``foo``, the formatter will wrap each250    output line in an anchor tag with an ``id`` (and `name`) of ``foo-linenumber``.251    This allows easy linking to certain lines.252 253    .. versionadded:: 0.9254 255`linespans`256    If set to a nonempty string, e.g. ``foo``, the formatter will wrap each257    output line in a span tag with an ``id`` of ``foo-linenumber``.258    This allows easy access to lines via javascript.259 260    .. versionadded:: 1.6261 262`anchorlinenos`263    If set to `True`, will wrap line numbers in <a> tags. Used in264    combination with `linenos` and `lineanchors`.265 266`tagsfile`267    If set to the path of a ctags file, wrap names in anchor tags that268    link to their definitions. `lineanchors` should be used, and the269    tags file should specify line numbers (see the `-n` option to ctags).270    The tags file is assumed to be encoded in UTF-8.271 272    .. versionadded:: 1.6273 274`tagurlformat`275    A string formatting pattern used to generate links to ctags definitions.276    Available variables are `%(path)s`, `%(fname)s` and `%(fext)s`.277    Defaults to an empty string, resulting in just `#prefix-number` links.278 279    .. versionadded:: 1.6280 281`filename`282    A string used to generate a filename when rendering ``<pre>`` blocks,283    for example if displaying source code. If `linenos` is set to284    ``'table'`` then the filename will be rendered in an initial row285    containing a single `<th>` which spans both columns.286 287    .. versionadded:: 2.1288 289`wrapcode`290    Wrap the code inside ``<pre>`` blocks using ``<code>``, as recommended291    by the HTML5 specification.292 293    .. versionadded:: 2.4294 295`debug_token_types`296    Add ``title`` attributes to all token ``<span>`` tags that show the297    name of the token.298 299    .. versionadded:: 2.10300 301 302**Subclassing the HTML formatter**303 304.. versionadded:: 0.7305 306The HTML formatter is now built in a way that allows easy subclassing, thus307customizing the output HTML code. The `format()` method calls308`self._format_lines()` which returns a generator that yields tuples of ``(1,309line)``, where the ``1`` indicates that the ``line`` is a line of the310formatted source code.311 312If the `nowrap` option is set, the generator is the iterated over and the313resulting HTML is output.314 315Otherwise, `format()` calls `self.wrap()`, which wraps the generator with316other generators. These may add some HTML code to the one generated by317`_format_lines()`, either by modifying the lines generated by the latter,318then yielding them again with ``(1, line)``, and/or by yielding other HTML319code before or after the lines, with ``(0, html)``. The distinction between320source lines and other code makes it possible to wrap the generator multiple321times.322 323The default `wrap()` implementation adds a ``<div>`` and a ``<pre>`` tag.324 325A custom `HtmlFormatter` subclass could look like this:326 327.. sourcecode:: python328 329    class CodeHtmlFormatter(HtmlFormatter):330 331        def wrap(self, source, *, include_div):332            return self._wrap_code(source)333 334        def _wrap_code(self, source):335            yield 0, '<code>'336            for i, t in source:337                if i == 1:338                    # it's a line of formatted code339                    t += '<br>'340                yield i, t341            yield 0, '</code>'342 343This results in wrapping the formatted lines with a ``<code>`` tag, where the344source lines are broken using ``<br>`` tags.345 346After calling `wrap()`, the `format()` method also adds the "line numbers"347and/or "full document" wrappers if the respective options are set. Then, all348HTML yielded by the wrapped generator is output.349�HTML�htmlz*.htmlz*.htmc��[R"U40UD6 URUR5Ul[	USS5Ul[	USS5UlURSS5Ul[R"URURSS555Ul[R"URURSS555UlURURS	S55Ul
URURS350S55Ul[	USS5UlURURSS55UlURURS
S55Ul[R"URURSS555Ul[	USS5Ul0Ul[	USS5UlUR (a;[,(d[/S5e[,R0"UR 5UlURSS5nUS:XaSUlOU(aSUlOSUl[7[9USS55Ul[7[9USS55Ul[7[9USS55Ul[	USS5Ul [R"URSS55Ul![R"URSS55Ul"[R"URSS55Ul#[	USS5Ul$[K5Ul&[OUS /5H(nURLRQ[SU55 M* URW5 g![Ta MJf=f)!N�nowrapF�	noclasses�classprefixr(�cssclass�	highlight�	cssstyles�	prestyles�cssfile�noclobber_cssfile�tagsfile�tagurlformat�filename�wrapcode�debug_token_typeszRThe "ctags" package must to be installed to be able to use the "tagsfile" feature.�linenos�inlinerrr�linenostart�351linenostep�
linenospecial�nobackground�
lineseparator�352�lineanchors�	linespans�
anchorlinenos�hl_lines),r�__init__�_decodeifneeded�titlerr6r7r+r8r4�escaper9r;r<r=r>r?r@rArB�span_element_openersrC�ctags�RuntimeError�CTags�_ctagsrD�absr	rFrGrHrIrJrLrMrN�setrOr353�add�int�354ValueError�_create_stylesheet)�self�optionsrD�linenos    rrP�HtmlFormatter.__init__�s������4�+�7�+��)�)�$�*�*�5��355�"�7�H�e�<���%�g�{�E�B���"�;�;�}�b�9������D�$8�$8����Z�Q\�9]�$^�_��
����T�%9�%9�'�+�+�k�SU�:V�%W�X����-�-�g�k�k�+�r�.J�K����+�+�G�K�K�	�2�,F�G���!-�g�7J�E�!R����,�,�W�[�[��R�-H�I��
� �0�0����^�R�1P�Q������D�$8�$8����Z�QS�9T�$U�V��
�$�W�j�%�@��
�$&��!�!-�g�7J�E�!R����=�=��5�"�$O�P�P��+�+�d�m�m�4�D�K��+�+�i��/���h���D�L�
��D�L��D�L��{�7�M�1�E�F����k�'�<��C�D��� ��W�o�q�!I�J���(��.�%�H���!�[�[����_�d�)K�L����;�;�w�{�{�=�"�'E�F������W�[�[��b�%A�B���)�'�?�E�J������
�"�7�J��;�F�
��
�
�!�!�#�f�+�.�<�	
���!���
��
�s�$O�356O�Oc�F�[U5nU(aURU-$g)zMReturn the css class of this token type prefixed with357the classprefix option.r()r0r8)r_r-�358ttypeclasss   r�_get_css_class�HtmlFormatter._get_css_class�s%��&�e�,�359���#�#�j�0�0�rc��URU5nU[;a/URnURU5S-U-nU[;aM/U=(d S$)zOReturn the CSS classes of this token type prefixed with the classprefix option.� r()rerr,)r_r-�clss   r�_get_css_classes�HtmlFormatter._get_css_classes�sS���!�!�%�(���>�)��L�L�E��%�%�e�,�s�2�S�8�C��>�)��y�b�rc��URRU5nUc,URnURRU5nUcM,U=(d S$)z1Return the inline CSS styles for this token type.r()�ttype2classr+r,)r_r-�cclasss   r�_get_css_inline_styles�$HtmlFormatter._get_css_inline_styles�sO���!�!�%�%�e�,���n��L�L�E��%�%�)�)�%�0�F��n��|��rc��[S0=ol0=o lURH�up4UR	U5nSnUS(a USR[
US55-
nUS(aUS-
nUS(aUS-
nUS(aUS	-
nUS360(a USR[
US36155-
nUS(a US
R[
US55-
nU(dM�XQU'USSU[U54X%'M� g)Nr(r%zcolor: {}; �boldzfont-weight: bold; �italiczfont-style: italic; �	underlineztext-decoration: underline; �bgcolorzbackground-color: {}; �borderzborder: 1px solid {}; �����)rrm�class2style�stylere�formatr&r$)r_�t2c�c2sr-�ndef�namerys       rr^� HtmlFormatter._create_stylesheet�s��"'���,���!#�#����:�:�K�E��&�&�u�-�D��E��G�}���-�-�f�T�'�]�.C�D�D���F�|��.�.���H�~��/�/���K� ��7�7���I���1�8�8���Y��9P�Q�Q���H�~��1�8�8���X��9O�P�P���u�!�E�362�#�3�B�Z���E�363�;��	�'&rNc���/nURUR55 URURU55 URURU55 SR	U5$)z�364Return CSS style definitions for the classes produced by the current365highlighting style. ``arg`` can be a string or list of selectors to366insert before the token type classes.367rK)�extend�get_linenos_style_defs�get_background_style_defs�get_token_style_defs�join)r_�arg�style_liness   r�get_style_defs�HtmlFormatter.get_style_defssa�������4�6�6�8�9����4�9�9�#�>�?����4�4�4�S�9�:��y�y��%�%rc
�h�URU5nURR5VVVVs/sHunupEnU(dMU(dMXeX44PM! nnnnnUR5 UVVVVs/sH#upep4U"U5SUS[	U5SSS3PM% nnnnnU$s snnnnfs snnnnf)Nz { z } /* rz */)�get_css_prefixrx�items�sort�repr)	r_r��prefixriryr-�level�styles�liness	         rr��"HtmlFormatter.get_token_style_defss����$�$�S�)��/3�.>�.>�.D�.D�.F�368�.F�*��*�e�E��
'��
'�U�3�&�.F�	�369�370	���
�/5�371�.4�*��s��c�{�m�4��w�g�d�5�k�!�"�o�->�c�B�.4�	�372�373���374��375s�B$376�B$377�B$378�3*B,379c���URU5nURRnURRn/nU(axUR(dgUbdSn[380UR;a&SURUR[381S-nURSSRU"S5X655 Ub(URSSRU"S5U55 U$)Nr(rhrz{}{{ background: {};{} }}z{} {{ background-color: {} }}�hll)382r�ry�background_color�highlight_colorrIrrmrx�insertrz)r_r�r��bg_color�hl_colorr��383text_styles       rr��'HtmlFormatter.get_background_style_defs%s����$�$�S�)���:�:�.�.���:�:�-�-�����t�(�(�X�-A��J��t�'�'�'� �4�#3�#3�D�4D�4D�T�4J�#K�A�#N�N�384��L�L��.�5�5��2�J���
�385���L�L��2�9�9�&��-��R�
��rc��SURS3SURS3SURS3SURS3SURS3/nU$)Nzpre { z }ztd.linenos .normal { zspan.linenos { ztd.linenos .special { zspan.linenos.special { )�386_pre_style�_linenos_style�_linenos_special_style)r_r�s  rr��$HtmlFormatter.get_linenos_style_defs<sm���d�o�o�&�c�*�$�T�%8�%8�$9��=��t�2�2�3�3�7�%�d�&A�&A�%B�#�F�&�t�'B�'B�&C�3�G�387���rc�^�Uc.SUR;=(a SUR-=(d Sn[U[5(aU/mO[	U5mU4SjnU$)Nr9�.r(c�>�U(aSU-n/nTH,nURU=(a US-=(d SU-5 M. SRU5$)Nr�rhr(z, )�appendr�)ri�tmpr��argss   �rr��,HtmlFormatter.get_css_prefix.<locals>.prefixOsK�����C�i���C����388�389�C�-�C�#�I�3��s�:�;���9�9�S�>�!r)r`r9�390isinstance�str�list)r_r�r�r�s   @rr��HtmlFormatter.get_css_prefixGsR����;�����-�C�#�d�m�m�2C�I�r�C��c�3����5�D���9�D�	"��
rc��g)Nzline-height: 125%;�)r_s rr��HtmlFormatter._pre_styleYs��#rc�l�URRnURRnSUSUS3$�Nzcolor: z; background-color: z(; padding-left: 5px; padding-right: 5px;)ry�line_number_color�line_number_background_color�r_r%r�s   rr��HtmlFormatter._linenos_style]s:���391�392�,�,���:�:�B�B�����3�4D�3E�Em�n�nrc�l�URRnURRnSUSUS3$r�)ry�line_number_special_color�$line_number_special_background_colorr�s   rr��$HtmlFormatter._linenos_special_stylecs:���393�394�4�4���:�:�J�J�����3�4D�3E�Em�n�nrc��[U[5(a<UR(aURUR5$UR5$U$�N)r��bytes�encoding�decode�r_�values  rrQ�HtmlFormatter._decodeifneededis:���e�U�#�#��}�}��|�|�D�M�M�2�2��<�<�>�!��rc#�F# �UR(GaO[RRUR5(a
URnOjURnU(a	USS:Xa[395e[RR
[RRU5UR5n[RRU5(aUR(d>[USSS9nUR[SUR!S	50-5 SSS5 OS[&[)UR*URUR,S9-4v� O9S[.[)UR*UR!S	5UR,S9-4v� UShv�N S[04v� g![396a( [S[RS9 URnGN)f=f!,(df   N�=f!["anS397UR$-UleSnAff=fN|7f)
Nrr
z^Note: Cannot determine output file name, using current directory as base for the CSS file name)�file�wzutf-8)r��	styledefs�bodyzError writing CSS file: )rRr=r�)rRr�r�)r=�os�path�isabsr~�AttributeErrorr��dirname�print�sys�stderr�existsr>�open�write�CSSFILE_TEMPLATEr��OSError�strerror�DOC_HEADER_EXTERNALCSS�dictrRr��398DOC_HEADER�399DOC_FOOTER)r_�inner�outfile�cssfilenamerA�cf�errs       r�400_wrap_full�HtmlFormatter._wrap_fullps�����<�<�<��w�w�}�}�T�\�\�*�*�"�l�l��/�&�|�|�H�#�x��{�c�'9�,�,�"$�'�'�,�,�r�w�w���x�/H�/3�|�|�#=�K�
��w�w�~�~�k�2�2�$�:P�:P��k�3��A�R����!1�"-�t�/B�/B�6�/J�!K�"L�M�B�A�;Q��,�����#'�<�<�$(�M�M�3�3�4�
4�401�j�����%)�%8�%8��%@�$(�M�M�3�3�4�
4�402�����m���5&�/��R�"�z�z�+�#'�,�,�K�	/��B�A���
�9�C�L�L�H�����
��	�s{�AH!�A)F2�;AG8�;*G'�%G8�-A5H!�"H�#H!�2.G$� H!�#G$�$H!�'403G5�1G8�4H!�5G8�8404H�H�H�H!c#�# �[5nSnUH"upEU(aUS-
nURU5 M$ URn[[	X6-S-40555nUR406nURn	UR=(d URn407URnURn/n
[XfU-5H�nX�-S:HnU=(a X�-S:HnU(aSX~4-nU(aSX�U4-nOSU-nU(a)U(aSURS3nOSURS3nOU(aSnOS	nU(a	S408USUS3nU
RU5 M� S
RU
5nSnUR (aSUR -S-nSSUR"S3U-S-U-S-4v� Sv� SUR%54v� Sv� Sv� g7f)Nrr�%*d�<a href="#%s-%d">%s</a>rh� style="rz class="special"z class="normal"�<spanr�</span>rKr(z<<tr><th colspan="2" class="filename"><span class="filename">z</span></th></tr>z<table class="ztable">z4<tr><td class="linenos"><div class="linenodiv"><pre>z"</pre></div></td><td class="code">)rz<div>)rz</div>)rz</td></tr></table>)rr�rFr$r�rHrGrLrMrNr7�ranger�r�r�r�rAr9�getvalue)r_r��dummyoutfile�lncount�t�line�fl�mw�sp�st�anchor_name�aln�noclsr��i�409print_line�special_linery�ls�filename_trs                    r�_wrap_tablelinenos� HtmlFormatter._wrap_tablelinenos�s�����z�����G�A���1������t�$��410�
�
��
��W�\�A�%�&�
'��
�
�
��
�_�_���&�&�8�$�.�.��� � ���������r�g�:�&�A���1��J��-�!�&�A�+�L����w����4���7M�M�D���R�x����&�t�'B�'B�&C�1�E�E�&�t�':�':�&;�1�=�E��.�E�-�E���u�g�Q�t�f�G�4���L�L���3'�6�Y�Y�u�
�����=�=�*�,0�M�M�:�=��
��N�4�=�=�/��9�K�G�B�C���5�6�7�	7�����&�&�(�(�(���%�%�s�GGc#�n# �[U5nURnURnURn[	[[	U5U-S-41155nUR=(d URnURnURn	UH�up�XT-S:HnU=(a XS-S:Hn
U(aSXe4-nOSU-nU	(a)U
(aSURS3nOSURS3nOU
(aSnOSnU(a412S	US413US3nOUnU(aSSXuU4-U-4v� O	SUU-4v� US-
nM� g7f)
Nrrr�rhr�rz class="linenos special"z class="linenos"r�rr�r�)r�rHrGrFr$r�rLrMrNr7r�r�)r_r��inner_linesr�r��numr�r�r�r��_�414inner_liner�r�r�ryrDs                 r�_wrap_inlinelinenos�!HtmlFormatter._wrap_inlinelinenos�sK����5�k��
�
�
��
�_�_������
��S��%��+�a�/�0�
1���&�&�8�$�.�.��� � ������(�M�A���Q��J��/�#�(�a�-�L����y�(���R�x����&�t�'B�'B�&C�1�E�E�&�t�':�':�&;�1�=�E��6�E�.�E��!�%���$��w�7������3�{��6Q�Q�$�%�&�&���:�-�-�-��1�H�C�=)�s�D3D5c#��# �URnURS-415nUHAupEU(a/US-
nUR(aSOSX#4-nSSX#X#U4-U-4v� M;SU4v� MC g7f)Nrr(z href="#%s-%d"z!<a id="%s-%d" name="%s-%d"%s></a>r)rLrFrD)r_r��sr�r�r��hrefs       r�_wrap_lineanchors�HtmlFormatter._wrap_lineanchorsst����������q� ���G�A���Q���!�\�\�r�/?�1�&�/H���<��a�D�?Q�Q�TX�X�X�X���g�
�
�s�A$A&c#�# �URnURS-416nUH$upEU(aUS-
nSSX#U4-4v� MSU4v� M& g7f)Nrz<span id="%s-%d">%s</span>r)rMrF)r_r�rr�r�r�s      r�_wrap_linespans�HtmlFormatter._wrap_linespanssT����N�N�����q� ���G�A���Q����5��t��D�D�D���g�
��s�AA	c#��# �/nUR(aPUR(d?URRb(UR	SURR35 UR417(aUR	UR4185 SR
U5nSSUR=(a SURS3-U=(a SUS3-S-4v� UShv�N S	v� gN	7f)419Nzbackground: �; rz<divz class="rr�r)rz</div>420)r7rIryr�r�r;r�r9�r_r�rys   r�	_wrap_div�HtmlFormatter._wrap_divs�������N�N�4�#4�#4��421�422�+�+�7��L�L�<��423�424�(C�(C�'D�E�F��>�>��L�L����(��	�	�%� ���&�D�M�M�I������q�.I�J��2����q�1�4�69�:�;�	;������	�s�C#C1�%C/�&425C1c#�# �/nUR(aURUR5 UR(aURUR5 SR	U5nUR426(a&URS:waSSUR427-S-4v� SSU=(a SUS3-S	-4v� UShv�N S428v� gN	7f)Nr429rrz<span class="filename">r�z<prer�rz><span></span>)rz</pre>)r<r�r7r�r�rArDrs   r�	_wrap_pre�HtmlFormatter._wrap_pre,s�������>�>��L�L����(��>�>��L�L����)��	�	�%� ���=�=�T�\�\�Q�.��/�$�-�-�?�)�K�L�L��&�E�9����q�&9�:�=M�M�N�N������	�s�CC�C
�430Cc#�4# �Sv� UShv�N Sv� gN	7f)N)rz<code>)rz</code>r�)r_r�s  r�431_wrap_code�HtmlFormatter._wrap_code=s����������	�s�432��433�d)�maxsizec�J�UR[5RS5$)z-HTML-escape a value and split it by newlines.rK)r�_escape_html_table�splitr�s  r�_translate_parts�HtmlFormatter._translate_partsBs�����1�2�8�8��>�>rc	#�2# �URnURnURnSn/nUGH�upxURUn	URU5n
U(a�U[R;a�URU5up�U(a�[R R#U5unnU(aUS	-
n[R R%U5unnUR&UUUS434.-nSUUR(X�S4-U
S'U
SS
-U
S'U
SSH�nU(akXY:wa0U(a)UR+U=(a SU	UU	=(a SU45 OUR+UU=(a SU45 SSRU54v� /nMuU(a$SSRU	UU	=(a SU454v� M�SU4v� M� U(aJU
S(a@XY:wa$UR+U=(a SX�S45 U	nGM�UR-U
S5 GM�U
S(dGM�X�S/nU	nGM� U(a2UR+U=(a SU45 SSRU54v� gg![a� UR435(a SR
SRU55OSn436U(a7URU5nU(aURUSnSUSU437S3n	O'Sn	O$URU5nU(a438SUSU439S3n	OSn	X�RU'GN�f=f7f)zL440Just format the tokens, without any wrapping tags.441Yield individual lines.442r(z title="{}"r�rz
<span style="rrz
<span class="�/)r�r.�fextz<a href="%s#%s-%d">%sr*z</a>Nr�r)r7rJr?rT�KeyErrorrCrzr�rorxrjrr�Name�_lookup_ctagr�r�r�splitextr@rLr�r�)r_�tokensourcer��lsepr?�lspanr�r-r��cspanrR�	css_style�	css_class�partsrA�443linenumber�base�	extension�url�parts                    r�
_format_lines�HtmlFormatter._format_linesGs����444�����!�!���=�=������'�L�E�
9��1�1�%�8��$�)�)�%�0�E��E�U�Z�Z�/�'+�'8�'8��'?�$���%'�W�W�]�]�8�%<�N�D�(������*,�'�'�*:�*:�8�*D�'�H�i��+�+�t�h�7@�/B�B�C�8��d�.�.�445�!�H�E� F�E�!�H� %�b�	�F� 2�E�"�I��c�r�446����~�$����e�&9�	�E�4�&+�&9�	�D�%B�C����T�E�,?�i�$�$G�H��R�W�W�T�]�*�*��D���R�W�W�e�T�E�4G�i�$�%O�P�P�P��T�'�M�#� ��b�	��>��K�K�%�"5�I��R�y� I�J�!�E��K�K��b�	�*��r����R�y�)����y(�~��K�K�%�-�I��5�6��R�W�W�T�]�"�"���y�
9�AE�AW�AW�
�,�,�S�X�X�e�_�=�]_��� $� ;� ;�E� B�I� �$(�$4�$4�Y�$?��$B�	�"/�	�{�!�E�7�!� D�� "�� $� 5� 5�e� <�I� �"/�	�{�!�E�7�!� D�� "��38�)�)�%�0�
9�s1�1L�I#�GL�AL�#B-L�L�L�Lc��[R"5nURRX!R	5S5(aUSR5US4$g)Nrr��447lineNumber)NN)rU�TagEntryrX�find�encoder�)r_�token�entrys   rr �HtmlFormatter._lookup_ctag�sK����� ���;�;���E�<�<�>�1�5�5���=�'�'�)�5��+>�>�>�rc#�D# �URn[U5H�unupEUS:waXE4v� US-U;a_UR(aBSnURRbSURRS3nSSUSUS34v� MoSS	US34v� M{SU4v� M� g7f)448z{449Highlighted the lines specified in the `hl_lines` option by450post-processing the token stream coming from `_format_lines`.451rr(Nz style="background-color: rr�rr�z<span class="hll">)rO�	enumerater7ryr�)r_r"�hlsr�r�r�rys       r�_highlight_lines�HtmlFormatter._highlight_lines�s����452�m�m��&�{�3�M�A�z���A�v��h���1�u��|��>�>��E��z�z�1�1�=�#=�d�j�j�>X�>X�=Y�YZ�![���u�U�G�1�U�G�7�;�;�;��1�%���@�@�@���h��4�s�BB c�p�UnUR(aURU5nURU5nU$)z�453Wrap the ``source``, which is a generator yielding454individual lines, in custom generators. See docstring455for `format`. Can be overridden.456)rBrr)r_�source�outputs   r�wrap�HtmlFormatter.wrap�s1�����=�=��_�_�V�,�F�����'���
rc�z�URU5nUR(d!URS:XaURU5nUR(aURU5nUR(d�UR(aURU5nUR(aURU5nURU5nURS:XaURU5nURU5nUR(aURX25nUHupEURU5 M g)a457The formatting process uses several nested generators; which of458them are used is determined by the user's options.459 460Each generator should take at least one argument, ``inner``,461and wrap the pieces of text generated by this.462 463Always yield 2-tuples: (code, text). If "code" is 1, the text464is part of the original tokensource being highlighted, if it's4650, the text is some piece of wrapping. This makes it possible to466use several different wrappers that process the original source467linewise, e.g. line number generators.468rrN)r.r6rDr�rOr;rLrrMrr@r�r�fullr�r�)r_r"r�r>r��pieces      r�format_unencoded�HtmlFormatter.format_unencoded�s����#�#�K�0���{�{�t�|�|�q�0��-�-�f�5�F��=�=��*�*�6�2�F��{�{�����/�/��7���~�~��-�-�f�5���Y�Y�v�&�F��|�|�q� ��0�0��8���^�^�F�+�F��y�y�����9���H�A��M�M�%� �r)rXrNrxr8r9r=r;rCrArOrLrDrHrFrGrJrMrIr7r>r6r<rTr?r@rRrmrBr�)(�__name__�469__module__�__qualname__�__firstlineno__�__doc__r~�aliases�	filenamesrPrerjror^r�r�r�r�r��propertyr�r�r�rQr�r�r�rrrrr�	functools�	lru_cacherr.r r;r@rE�__static_attributes__r�rrrr{s���c�J	�D��h�G��7�#�I�/"�b���<�0&��"�.	��$�$��$��o��o�470�o��o�471�'�RA&�H)�V472����"�473����%�?�&�?�L#�\��*
�%!r)rKrOr�r��os.path�ior�pygments.formatterr�pygments.tokenrrr�
pygments.utilrr	r474r4rU�ImportError�__all__�ordrrr&r0r�r�r�r�rr�rr�<module>rZs�����	�475���(�6�6�A�A�����476����H�g���H�f���H�f���H�h���H�g���/�!�477�	���
��
���478�*
���479�j
!�I�j
!��E���E��s�B�B�B
codekingpro/portable-devtools · Team Ai