HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/thread-self/root/lib64/python2.7/site-packages/hgext/highlight/__init__.pyo
�
1�3\c@@s�dZddlmZddlmZddlmZmZddlm	Z	dZ
d�Zd	�Zd
�Z
d�Zd�Zd
S(stsyntax highlighting for hgweb (requires Pygments)

It depends on the Pygments syntax highlighting library:
http://pygments.org/

There are the following configuration options::

  [web]
  pygments_style = <style> (default: colorful)
  highlightfiles = <fileset> (default: size('<5M'))
  highlightonlymatchfilename = <bool> (default False)

``highlightonlymatchfilename`` will only highlight files if their type could
be identified by their filename. When this is not enabled (the default),
Pygments will try very hard to identify the file type from content and any
match (even matches with a low confidence score) will be used.
i(tabsolute_importi(t	highlight(twebcommandstwebutil(t
extensionssships-with-hg-corec	C@s�|jddd�}|jddd�}|jddt�}|j�}|j|�}||j��r�tj||||d|�ndS(Ntwebtpygments_styletcolorfulthighlightfilesssize('<5M')thighlightonlymatchfilenametguessfilenameonly(tconfigt
configbooltFalset	changectxtmatchfilesettpathRt
pygmentize(	Rtfieldtfctxttmpltstyletexprtfilenameonlytctxtm((s>/usr/lib64/python2.7/site-packages/hgext/highlight/__init__.pyR/scC@sB|jjd}d|kr5t|d||j�n|||�S(NsContent-Typethtmltfileline(trestheadersRR(torigRRtmt((s>/usr/lib64/python2.7/site-packages/hgext/highlight/__init__.pytfilerevision_highlight:scC@sW|jjd}d|krMtj|j|j�}t|d||j�n||�S(NsContent-TypeRtannotateline(RRRtfilectxtrepotreqRR(RRRR((s>/usr/lib64/python2.7/site-packages/hgext/highlight/__init__.pytannotate_highlightHs
cC@sp|jddd�}tjd|�}d|jjd<|jjdjd||jd�g��|jj�S(	NRRRRstext/csssContent-Typets/* pygments_style = %s */

(	RRt
HtmlFormatterRRtsetbodybytestjointget_style_defstsendresponse(Rtpg_styletfmter((s>/usr/lib64/python2.7/site-packages/hgext/highlight/__init__.pytgenerate_cssPscC@sCtjtdt�tjtdt�tt_tjjd�dS(Nt
_filerevisiontannotatethighlightcss(	RtwrapfunctionRR R%R.R1t__all__tappend(((s>/usr/lib64/python2.7/site-packages/hgext/highlight/__init__.pytextsetupZs
	N(t__doc__t
__future__RR&Rtmercurial.hgwebRRt	mercurialRt
testedwithRR R%R.R5(((s>/usr/lib64/python2.7/site-packages/hgext/highlight/__init__.pyt<module>s