VULN_CHECK_I913V6 j0vdZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z gde ezZiZiZdZd Zd Zd Zd Zdd ZdZGddej0Zej4eZeeZej<j?ej<eej4e<e`e`e`e`y)z pygments.formatters ~~~~~~~~~~~~~~~~~~~ Pygments formatters. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)basename) FORMATTERS)find_plugin_formatters) ClassNotFound)get_formatter_by_nameget_formatter_for_filenameget_all_formattersload_formatter_from_filec|tvrBtjtj|x}t|<|j |St|j |S)zBReturn whether the supplied file name fn matches pattern filename.)_pattern_cacherecompilefnmatch translatematch)fnglobpatterns M/usr/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__init__.py _fn_matchesrsR >!)+G4E4Ed4K)LL.&}}R  $  % %b ))ct|dddg}|jD]!}t||}|t|j<#y)z4Load a formatter (and all others in the module too).N__all__) __import__rgetattr_formatter_cachename) module_namemodformatter_nameclss r_load_formattersr"$s= [$yk :C++c>*%("&rc#KtjD])}|dtvrt|dt|d+t D] \}}| yw)z-Return a generator for all formatter classes.rN)rvaluesrr"r)info_ formatters rr r ,s[!!# 7* * T!W %tAw''$/0 91sAActjD]*\}}}}}||vs|tvr t|t|cSt D]\}}||j vs|cSy)zALookup a formatter by alias. Returns None if not found. N)rr%rr"raliases)aliasrrr*r'r!s rfind_formatter_classr,7sk -7,=,=,?( T7Aq G ++ -#D) ) -@ )*3 CKK J+rc Ht|}|td|z|di|S)a Return an instance of a :class:`.Formatter` subclass that has `alias` in its aliases list. The formatter is given the `options` at its instantiation. Will raise :exc:`pygments.util.ClassNotFound` if no formatter with that alias is found. zno formatter found for name %r)r,r)_aliasoptionsr!s rrrFs0 v &C {>rc L i}t|d5}t|j|ddd||vrtd|d|||}|di|S#1swY+xYw#t$r}td|d|d}~wt$rt $r}td|zd}~wwxYw) a# Return a `Formatter` subclass instance loaded from the provided file, relative to the current directory. The file is expected to contain a Formatter class named ``formattername`` (by default, CustomFormatter). Users should be very careful with the input, because this method is equivalent to running ``eval()`` on the input file. The formatter is given the `options` at its instantiation. :exc:`pygments.util.ClassNotFound` is raised if there are any errors loading the formatter. .. versionadded:: 2.2 rbNz no valid z class found in z cannot read z: z'error when loading custom formatter: %sr.)openexecreadrOSError Exception)filename formatternamer0custom_namespacefformatter_classerrs rr r TsM (D !Q + ,"  0 0!.!:; ;*=9)))" ! DHcBCC  MEKLLMs9A!A)A!AA!! B#*A;;B#BB#c Rt|}tjD]@\}}}}}|D]3}t||s|tvr t |t |di|ccSBt D]+}|jD]}t||s|di|ccS-td|z)a Return a :class:`.Formatter` subclass instance that has a filename pattern matching `fn`. The formatter is given the `options` at its instantiation. Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename is found. z#no formatter found for file name %rr.) rrr%rrr"r filenamesr)rr0modnamerr'r?r8r!s rrrws "B*4*;*;*=&q)Q!H2x(//$W-'-888 "+> &' H2x(~W~%&( =B CCrceZdZdZdZy) _automodulez Automatically import formatters.ctj|}|r)t|dt|d}t ||||St |)Nrr$)rgetr"rsetattrAttributeError)selfrr&r!s r __getattr__z_automodule.__getattr__sI~~d#  T!W %"47+C D$ $JT""rN)__name__ __module__ __qualname____doc__rHr.rrrBrBs *#rrB)CustomFormatter) rLr systypesros.pathr(pip._vendor.pygments.formatters._mappingrpip._vendor.pygments.pluginrpip._vendor.pygments.utilrlistrrr rr"r r,rr r ModuleTyperBmodulesrIoldmodnewmod__dict__updater.rrr[s ?>3 =?CJ?O P*)   MFD, #%"" # X  X v' H M6=&*flr