bg/hddlmZddlmZddlmZmZmZmZddl m Z m Z m Z m Z GddZdS)) annotations)NoReturn)DeletedMessageErrorInvalidMessageErrorMessageBecameExtensionErrorUnknownMessageError)is_deleted_msgidis_deleted_symbolis_moved_msgidis_moved_symbolceZdZdZddZddZddZd d Zd!d Zd"dZ d#dZ d$dZ d#dZ e d%dZe d&dZd'dZdS)(MessageIdStorezpThe MessageIdStore store MessageId and make sure that there is a 1-1 relation between msgid and symbol. returnNonec>i|_i|_i|_i|_dSN) _MessageIdStore__msgid_to_symbol _MessageIdStore__symbol_to_msgid_MessageIdStore__old_names_MessageIdStore__active_msgidsselfs p/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/message/message_id_store.py__init__zMessageIdStore.__init__s(13131357intc*t|jSr)lenrrs r__len__zMessageIdStore.__len__#s4)***rstrcjd}|jD]\}}|d|d|dz }|dz }|S)NzMessageIdStore: [ z - z (z) ])ritems)rresultmsgidsymbols r__repr__zMessageIdStore.__repr__&sW&!399;; 2 2ME6 1U11f111 1FF#  rr%c |j|S#t$r}d|d}t||d}~wwxYwN'z%' is not stored in the message store.)rupperKeyErrorr)rr%emsgs r get_symbolzMessageIdStore.get_symbol-s\ 2)%++--8 8 2 2 2BeBBBC%c** 1 2s! AAAr&cn |j|S#t$r}d|d}t||d}~wwxYwr))rr,r)rr&r-r.s r get_msgidzMessageIdStore.get_msgid4sT 2)&1 1 2 2 2CfCCCC%c** 1 2s  4/4 old_nameslist[tuple[str, str]]c|||||||D]2\}}|||||||3dSr)check_msgid_and_symboladd_msgid_and_symboladd_legacy_msgid_and_symbol)rr%r&r2 old_msgid old_symbols rregister_message_definitionz*MessageIdStore.register_message_definition;s ##E6222 !!%000%. K K !Iz  ' ' : > > >  , ,Y E J J J J K Krc.||j|<||j|<dS)zAdd valid message id. There is a little duplication with add_legacy_msgid_and_symbol to avoid a function call, this is called a lot at initialization. N)rr)rr%r&s rr6z#MessageIdStore.add_msgid_and_symbolDs$ )/u%).v&&&r new_msgidc||j|<||j|<|j|g}||||j|<dS)zAdd valid legacy message id. There is a little duplication with add_msgid_and_symbol to avoid a function call, this is called a lot at initialization. N)rrrgetappend)rr%r&r<existing_old_namess rr7z*MessageIdStore.add_legacy_msgid_and_symbolMs^)/u%).v&!-11%<<!!),,,"4rc|j|}|j|}||dS|||kr|||||r||kr||||dSdSdSr)rr>r_raise_duplicate_msgid_raise_duplicate_symbol)rr%r&existing_msgidexisting_symbols rr5z%MessageIdStore.check_msgid_and_symbol[s%)%;%?%?%G%G&*&<&@&@&G&G  "~'= F  %&&++FE>JJJ  I&88  ( ( H H H H H I I88r other_symbolrc||g}|d|d}|d|dd|ddz }t|)z+Raise an error when a symbol is duplicated.z Message id 'z' cannot have both r*r' and 'z' as symbolic name.sortr)r%r&rFsymbols error_messages rrCz&MessageIdStore._raise_duplicate_symbolgs_<( AuAAA OWQZOO OOOO !-000r other_msgidc ||g}|d|d|dd|dd|d }t|)z*Raise an error when a msgid is duplicated.zMessage symbol 'z' cannot be used for 'rrHrIz?' at the same time. If you're creating an 'old_names' use 'old-z' as the old symbol.rJ)r&r%rNmsgidsrMs rrBz%MessageIdStore._raise_duplicate_msgidps%  Xv X Xq  X X"() X X;A X X X  "-000rmsgid_or_symbol list[str]cf |j|S#t$rYnwxYwd}d}|ddrQ|}|j|}|s t |}|t|}n>|}|j|}|s t|}|t|}|r|s9|t|||t||d|d}t||j||g}||j|<|S)zReturn msgids but the input can be a symbol. self.__active_msgids is used to implement a primitive cache for this function. NrIzNo such message id or symbol 'z'.)rr,isdigitr+rr>r r rr r rrrr)rrQdeletion_reason moved_reasonr%r& error_msgidss rget_active_msgidsz MessageIdStore.get_active_msgids|sv  '8 8    D   122  & & ( ( ;#))++E+//66F 9"25"9"9"*#1%#8#8L$F*..??E ;"3F";";"*#26#:#:L 1F 1*)/?KKK'1/<PPPLLLLI%i00 0""55'2203_- s  N)rr)rr)rr )r%r rr )r&r rr )r%r r&r r2r3rr)r%r r&r rr)r%r r&r r<r rr)r%r r&r rFr rr)r&r r%r rNr rr)rQr rrR)__name__ __module__ __qualname____doc__rrr'r/r1r:r6r7r5 staticmethodrCrBrYrrrrs.8888 ++++22222222KKKK//// 5 5 5 5 I I I I111\1 1 1 1\ 1''''''rrN) __future__rtypingrpylint.exceptionsrrrr#pylint.message._deleted_message_idsr r r r rr_rrrds #""""" LLLLLLLLLLr