Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
Ë
â{|j ã ó‚ — d Z ddlmZ ddlmZ ddlmZmZmZ d„ Z d„ Z
d„ Zd„ Zd „ Z
d
„ Z G d„ dej « Zy
)a‹ Fixer for __metaclass__ = X -> (metaclass=X) methods.
The various forms of classef (inherits nothing, inherits once, inherits
many) don't parse the same in the CST so we look at ALL classes for
a __metaclass__ and if we find one normalize the inherits to all be
an arglist.
For one-liner classes ('class X: pass') there is no indent/dedent so
we normalize those into having a suite.
Moving the __metaclass__ into the classdef can also cause the class
body to be empty so there is some special casing for that as well.
This fixer also tries very hard to keep original indenting and spacing
in all those corner cases.
é )Ú
fixer_base)Útoken)ÚsymsÚNodeÚLeafc ó¦ — | j D ]Â }|j t j k( r
t |« c S |j t j
k( sŒK|j sŒX|j d }|j t j k( sŒ…|j sŒ’|j d }t |t « sŒ²|j dk( sŒÂ y y)zì we have to check the cls_node without changing it.
There are two possibilities:
1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
2) clsdef => simple_stmt => expr_stmt => Leaf('__meta')
é Ú
__metaclass__TF)
ÚchildrenÚtyper ÚsuiteÚ
has_metaclassÚsimple_stmtÚ expr_stmtÚ
isinstancer Úvalue)ÚparentÚnodeÚ expr_nodeÚ left_sides ú4/usr/lib64/python3.12/lib2to3/fixes/fix_metaclass.pyr r s™ € ð —”ˆØ�9‰9œŸ
™
Ò"Ü Ó&Ò&Ø
�Y‰Yœ$×*Ñ*Ó
*¨t¯}«}ØŸ
™
aÑ(ˆIØ�~‰~¤§¡Ó/°I×4FÓ4FØ%×.Ñ.¨qÑ1� ܘi¬Õ.Ø!Ÿ™¨?Ó:Ùð ð ó c ó — | j D ]! }|j t j k( sŒ! y t | j « D ]$ \ }}|j t
j k( sŒ$ n t d« ‚t t j g « }| j |dz d rT| j |dz }|j |j « « |j « | j |dz d rŒT| j |« |}y)zf one-line classes don't get a suite in the parse tree so we add
one to normalize the tree
NzNo class suite and no ':'!é )r r r r
Ú enumerater ÚCOLONÚ
ValueErrorr Úappend_childÚcloneÚremove)Úcls_noder Úir
Ú move_nodes r Úfixup_parse_treer$ - sé € ð ×!Ô!ˆØ�9‰9œŸ
™
Ó"áð "ô ˜X×.Ñ.Ö/‰ˆˆ4Ø�9‰9œŸ™Ó#Ùð 0ô Ð5Ó6Ð6ô
”—‘˜RÓ €EØ
×
Ñ
˜A˜a™C˜DÑ
!Ø×%Ñ% a¨¡cÑ*ˆ Ø
×ј9Ÿ?™?Ó,Ô-Ø×ÑÔð ×
Ñ
˜A˜a™C˜DÒ
!ð
×ј%Ô Ø�Dr c óx — t |j « D ]$ \ }}|j t j k( sŒ$ n y|j « t
t j g « }t
t j |g« }|j |d rN|j | }|j |j « « |j « |j |d rŒN| j ||« |j d j d }|j d j d } | j |_
y)zÑ if there is a semi-colon all the parts count as part of the same
simple_stmt. We just want the __metaclass__ part so we move
everything after the semi-colon into its own simple_stmt node
Nr )r r r r ÚSEMIr r r r r r r Úinsert_childÚprefix)
r r" Ú stmt_nodeÚsemi_indr Únew_exprÚnew_stmtr# Ú new_leaf1Ú old_leaf1s
r Úfixup_simple_stmtr/ G s € ô
$ I×$6Ñ$6Ö7‰ˆ�$Ø�9‰9œŸ
™
Ó"Ùð 8ð à‡K�K„MÜ”D—N‘N BÓ'€HÜ”D×$Ñ$ x jÓ1€HØ
×
Ñ
˜X˜YÑ
'Ø×&Ñ& xÑ0ˆ Ø×јiŸo™oÓ/Ô0Ø×ÑÔð ×
Ñ
˜X˜YÒ
'ð ×ј˜8Ô$Ø×!Ñ! !Ñ$×-Ñ-¨aÑ0€IØ×"Ñ" 1Ñ%×.Ñ.¨qÑ1€IØ ×'Ñ'€IÕr c ó® — | j rI| j d j t j k( r| j d j « y y y )Néÿÿÿÿ)r r r ÚNEWLINEr )r s r Úremove_trailing_newliner3 _ s@ € ؇}‚}˜Ÿ™ rÑ*×/Ñ/´5·=±=Ò@Ø�
‰
�bÑ× Ñ Õ"ð A€}r c # ó6 K — | j D ]! }|j t j k( sŒ! n t d« ‚t t
|j « « D ]¹ \ }}|j t j k( sŒ$|j sŒ1|j d }|j t j k( sŒ^|j sŒk|j d }t |t « sŒ‹|j dk( sŒ›t |||« t |« |||f–— Œ» y w)NzNo class suite!r r
)r r r r
r Úlistr r r r r r r/ r3 )r! r r" Úsimple_noder Ú left_nodes r Ú
find_metasr8 d sà è ø€ à×!Ô!ˆØ�9‰9œŸ
™
Ó"Ùð "ô Ð*Ó+Ð+ô œy¨¯©Ó7Ö8‰ˆˆ;Ø×Ñœt×/Ñ/Ó/°K×4HÓ4HØ#×,Ñ,¨QÑ/ˆIØ�~‰~¤§¡Ó/°I×4FÓ4Fà%×.Ñ.¨qÑ1� ܘi¬Õ.Ø!Ÿ™¨?Ó:ä% d¨A¨{Ô;Ü+¨KÔ8Ø KÐ0Ó0ñ 9ùs/ ‚-D°AD DÂ
,DÂ:DÃDÃ'DÃ7"Dc ó~ — | j ddd… }|r1|j « }|j t j k( rn|rŒ1|rv|j « }t |t « r1|j t j k7 r|j rd|_ y|j |j ddd… « |rŒuyy)z› If an INDENT is followed by a thing with a prefix then nuke the prefix
Otherwise we get in trouble when removing __metaclass__ at suite start
Nr1 Ú )
r Úpopr r ÚINDENTr r ÚDEDENTr( Úextend)r
Úkidsr s r Úfixup_indentr@ { s” € ð �>‰>™$˜B˜$Ñ€Dá
Ø�x‰x‹zˆØ�9‰9œŸ™Ò$Øò ñ Ø�x‰x‹zˆÜ�dœDÔ! d§i¡i´5·<±<Ò&?Ø�{Š{Ø �”Øà�K‰K˜Ÿ
™
¡d¨ dÑ+Ô,ô r c ó — e Zd ZdZdZd„ Zy)ÚFixMetaclassTz
classdef
c óÎ — t |« sy t |« d }t |« D ] \ }}}|}|j « Œ |j d j
}t
|j « dk( r†|j d j
t j k( r|j d }�n4|j d j « } t t j | g« }|j d|« nét
|j « dk( r-t t j g « }|j d|« n¤t
|j « dk( r�t t j g « }|j dt t j d« « |j d|« |j dt t j d« « nt# d « ‚|j d j d }
d
|
_ |
j&