YBFj<&dZddlZddlmZmZddlmZmZmZm Z ddl m Z m Z m Z mZmZmZmZmZmZmZddlmZgdZGdd eZGd d eZGd d eZGddeZGddeZGddeZdS)z pygments.lexers.textfmts ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various text formats. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) guess_lexerget_lexer_by_name) RegexLexerbygroupsdefaultinclude) TextCommentOperatorKeywordNameStringNumberGenericLiteral Punctuation) ClassNotFound) IrcLogsLexer TodotxtLexer HttpLexer GettextLexer NotmuchLexerKernelLogLexerc feZdZdZdZdgZdgZdgZdZdZ e j e j zZ dZd efd ezd zeejejfd ezd zeejejd fd ezdzeejeejfd ezdzeejeeefdefgdejfdedfgdZdS)rzD Lexer for IRC logs in *irssi*, *xchat* or *weechat* style. zIRC logsircz *.weechatlogz text/x-irclogz1https://en.wikipedia.org/wiki/Internet_Relay_Chataf ( # irssi / xchat and others (?: \[|\()? # Opening bracket or paren for the timestamp (?: # Timestamp (?: (?:\d{1,4} [-/])* # Date as - or /-separated groups of digits (?:\d{1,4}) [T ])? # Date/time separator: T or space (?: \d?\d [:.])* # Time as :/.-separated groups of 1 or 2 digits (?: \d?\d) ) (?: \]|\))?\s+ # Closing bracket or paren for the timestamp | # weechat \d{4}\s\w{3}\s\d{2}\s # Date \d{2}:\d{2}:\d{2}\s+ # Time + Whitespace | # xchat \w{3}\s\d{2}\s # Date \d{2}:\d{2}:\d{2}\s+ # Time + Whitespace )? z^\*\*\*\*(.*)\*\*\*\*$^z(\s*<[^>]*>\s*)$z/ (\s*<.*?>\s*) # Nick msgzo (\s*[*]\s+) # Star (\S+\s+.*?\n) # Nick + rest of message z (\s*(?:\*{3}|?)\s*) # Star(s) or symbols (\S+\s+) # Nick + Space (.*?\n) # Rest of message z^.*?\nz \S+:(?!//)z.*\n#pop)rootrN)__name__ __module__ __qualname____doc__namealiases filenames mimetypesurl version_addedreVERBOSE MULTILINEflags timestampr rPreprocr Tagr rInsertedrr AttributetokensFC:\PYTHON\_runtimes\venv\Lib\site-packages\pygments/lexers/textfmts.pyrrsG DgG I !I =CM J %EI2' 0 9_2 2HHW_dh4W4W X 9_ 22 Xgotx 0 0% 99_ DDXgow0@ A A C 9_ FFXgow @ @  B  ) .DN + dF # /FFFr6rceZdZdZdZddgZddgZgdZdZd Z d d e j fd e j fd e jfdeeejefdefdeejeefdeejejejeefgiZdS)rz* Lexer for Gettext catalog files. zGettext Catalogpotpoz*.potz*.po)zapplication/x-gettextztext/x-gettextz text/gettextz$https://www.gnu.org/software/gettextz0.9r z ^#,\s.*?$z ^#:\s.*?$z^(#|#\.\s|#\|\s|#~\s|#\s).*$z^(")([A-Za-z-]+:)(.*")$z^".*"$z0^(msgid|msgid_plural|msgstr|msgctxt)(\s+)(".*")$z^(msgstr\[)(\d)(\])(\s+)(".*")$N)r!r"r#r$r%r&r'r(r)r*r Type Declarationr Singlerrr PropertyVariabler rIntegerr4r5r6r7rrXs DdmG&!IKKKI 0CM  7< ( 7. / ,gn = ' XfdmV 4 4 6   @ XdmT6 2 2 4 / XdmV^T]D& Q Q S  FFFr6rc eZdZdZdZdgZdZdZej Z ddZ dZ d Z d Zd eejeejeejeeed fd eejeeeeeejed fgde fde fdedfgdefgdZdZdS)rz" Lexer for HTTP sessions. HTTPhttpzhttps://httpwg.org/specsz1.5r c<d|_tj|||S)zReset the content-type state.N) content_typerget_tokens_unprocessed)selftextstacks r7rGz HttpLexer.get_tokens_unprocesseds 0tUCCCr6c#K|ddkra|d}d|vr/|d|d}||_|dt j|dfV|dt|dfV|dt|dfV|dt|dfV|dt|dfV|dt|dfVdS) Nz content-type;) grouplowerstripfindrFstartr r3r r r)rHmatchrFs r7header_callbackzHttpLexer.header_callbacksq ;;q>>   ! !^ 3 3 ;;q>>//11Ll""+,C\->->s-C-C,CDJJLL ,D kk!nndnekk!nn<<<<kk!nndEKKNN2222kk!nnh A6666kk!nndEKKNN2222kk!nngu{{1~~5555kk!nndEKKNN222222r6c#6K|dt|dfV|dt|dfV|dt|dfVdS)NrLrOrP)rWr rSr)rHrXs r7continuous_header_callbackz$HttpLexer.continuous_header_callbackskk!nndEKKNN2222kk!nngu{{1~~5555kk!nndEKKNN222222r6c#Kt|dd}|}|}|rddlm}|g}d|vr+t jdd|}|||D]F} ||} | |D]\} } } || z| | fVdS#t$rYCwxYw|t|fVdS)NrFr)get_lexer_for_mimetype+z^(.*)/.*\+(.*)$z\1/\2) getattrrSrWpygments.lexersr]r+subappendrGrr ) rHrXrFcontentoffsetr]possible_lexer_mimetypes general_typeilexeridxtokenvalues r7content_callbackzHttpLexer.content_callbacks5t^T:: ++--   > > > > > >(4~ $l"" "v&8(&2 4 4 (// ===-  22155E.3-I-I'-R-R99)UE$slE588888FF %D dG######s; B// B<;B<zL([a-zA-Z][-_a-zA-Z]+)( +)([^ ]+)( +)(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)headerszF(HTTP)(/)(1\.[01]|2(?:\.0)?|3)( +)(\d{3})(?:( +)([^\r\n]*))?(\r?\n|\Z)z(([^\s:]+)( *)(:)( *)([^\r\n]*)(\r?\n|\Z)z([\t ]+)([^\r\n]+)(\r?\n|\Z)z\r?\nrcz.+)r rmrcc:tfddDS)Nc3FK|]}tj|duVdS)N)r+search).0patternrIs r7 z)HttpLexer.analyse_text..sH   Igt $ $D 0      r6)zM^([a-zA-Z][-_a-zA-Z]+)( +)([^ ]+)( +)(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)zG^(HTTP)(/)(1\.[01]|2(?:\.0)?|3)( +)(\d{3})(?:( +)([^\r\n]*))?(\r?\n|\Z))anyrIs`r7 analyse_textzHttpLexer.analyse_texts=          r6N)rD)r!r"r#r$r%r&r)r*r+DOTALLr.rGrYr[rlrr Functionr Namespacer Reservedr r Exceptionr4rvr5r6r7rrts= DhG $CM IEDDDD 3 3 3333 $$$69 XdmT4>4&&$@@    W Xg&&$nd,,    9/ J ,.H I tY ' $ % #F,     r6rc eZdZdZdZdZdgZdZddgZdgZ e Z e Z ejZejZejZeZd Zd Zd Zd Zd ezdzZedzezdzZdezdzezdzZeee ee edfeee edfeeee edfeedfeedfeedfeedfde dfgde dfeefeefde fde fgde dfeefeefde fde fgdZdS)rz. Lexer for Todo.txt todo list format. Todotxtzhttp://todotxt.com/todotxtz2.0ztodo.txtz *.todotxtz text/x-todoz\d{4,}-\d{2}-\d{2}z \([A-Z]\)z\+\S+z@\S+z(x )()z( )((z)( )(complete incompletez\S+z\s*\nrz\s+)r rrN) r!r"r#r$r%r)r&r*r'r(r CompleteTaskTextr IncompleteTaskTextrHeadingPriority SubheadingDateErrorProjectrContext date_regexpriority_regex project_regex context_regexcomplete_one_date_regexcomplete_two_date_regexpriority_date_regexrr4r5r6r7rrs D CkGM[)II H  DmGG'J!NMM'3d:6@) *,0 1/(:ZG$N%hh/?/?'G'G  %hh/?&F&F   !((85G"N"N  X| 4 | , G\ 2 G\ 2 ' 6/ :' 0 G $ G $ % & % &  )6 2 G $ G $ ' ( ' (  U55FFFr6rc eZdZdZdZdZdgZdZdZde dfgd e e j e fd e e j ejfd e e j e fed gd e d fde dfde dfgde d fde e j e fde ejee jfgde dfde dfde d fgde e j ejfde ee j e fde ee j e fed gde d fde dfd efd!efgd"Zd#Zd$Zd%S)&rz For Notmuch email text format. Additional options accepted: `body_lexer` If given, highlight the contents of the message body with the specified lexer, else guess it according to the body content (default: ``None``). Notmuchzhttps://notmuchmail.org/notmuchz2.5c#&K|d} |jrt|j}n!t|}n#t $rtd}YnwxYw||Ed{VdS)NrLrI)rS body_lexerrrrUrrG)rHrXcoderhs r7_highlight_codezNotmuchLexer._highlight_codeDs{{1~~ . 2)$/::#DJJLL11 . . .%f--EEE .//55555555555s=AA32A3z\fmessage\{\s*)message message-attrz(\s*id:\s*)(\S+)z&(\s*(?:depth|match|excluded):\s*)(\d+)z(\s*filename:\s*)(.+\n)rz \fmessage\}\nz \fheader\{\nheaderz \fbody\{\nbodyz \fheader\}\nz'((?:Subject|From|To|Cc|Date):\s*)(.*\n)z(.*)(\s*\(.*\))(\s*\(.*\)\n)z \fpart\{\npartz\f(part|attachment)\{\s*)r part-attrz \fbody\}\nz (ID:\s*)(\d+)z*(,\s*)((?:Filename|Content-id):\s*)([^,]+)z(,\s*)(Content-type:\s*)(.+\n)z\f(?:part|attachment)\}\nz\f(?:part|attachment)\{\s*)z#pushrz^Non-text part: .*\nz&(?s)(.*?(?=\f(?:part|attachment)\}\n)))r rrrrrrc4|drdndS)Nz message{g?g) startswithrus r7rvzNotmuchLexer.analyse_text~sool336"B"B C 6 Xdnfn 5 5 7 ' Xdnf - - / GFOO  w / gx 0 GV , gv . 7 Xdnf - - / , Xgngtx 8 8 :  GV , ('3H I GV , xxGG H : Xk4>6 : : < . Xk4>6 : : < GFOO  *7F ; *G5K L $g . 6 H  K++FZ===-----r6rc 6eZdZdZdZddgZddgZdZdZd e d fd e d fd e dfde dfde dfde dfde dfgde dfde dfe d gde fde fde dfge ddedfge dde dfge ddejdfge ddejdfgdZdS)rz0 For Linux Kernel log ("dmesg") output. z Kernel logkmsgdmesgz*.kmsgz*.dmesgz#https://fr.wikipedia.org/wiki/Dmesgz2.6z^[^:]+:debug : (?=\[)debugz^[^:]+:info : (?=\[)infoz^[^:]+:warn : (?=\[)warnz^[^:]+:notice: (?=\[)z^[^:]+:err : (?=\[)errorz^[^:]+:crit : (?=\[)z^(?=\[)unknownz(^(?=.+(warning|notice|audit|deprecated))z ^(?=.+(error|critical|fail|Bug))z \[[0-9. ]+\] z (?<=\] ).+?:z\nrbasez.+\n)r rrrrrrN)r!r"r#r$r%r&r'r)r*r rrr rr rrrr4r5r6r7rrsR DwG9%I /CM&tW 5 %tV 4 %tV 4 %tV 4 %tW 5 %tW 5 y ) 9$ G 0$ @ GFOO v & g & D& ! GFOO gv & GFOO dF # GFOO gnf - GFOO gmV , A$$FFFr6r)r$r+r`rrpygments.lexerrrrrpygments.tokenr r r r r rrrrr pygments.utilr__all__rrrrrrr5r6r7rs ::::::::AAAAAAAAAAAA************************'''''' - - ->>>>>:>>>B:8Y Y Y Y Y Y Y Y xaaaaa:aaaHO-O-O-O-O-:O-O-O-d.....Z.....r6