Files
aitsc/.venv/Lib/site-packages/sqlalchemy/event/__pycache__/legacy.cpython-312.pyc

86 lines
9.1 KiB
Plaintext
Raw Normal View History

2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-29 00:34:40 +08:00
<00><19>h!<00><01><><00>dZddlmZddlZddlmZddlmZddlmZddlmZddlmZdd lm Z d
2025-02-23 09:07:52 +08:00
d l
m Z d
d l
m Z d dl mZd dlmZej"r d
dlmZd
dlmZeeeeeedeffZ d dd<13>Z dd<14>Zdd<15>Z dd<16>Z dd<17>Z d d<18>Z d!d<19>Zy)"zhRoutines to handle adaption of legacy call signatures,
generation of deprecation notes and docstrings.
<EFBFBD>)<01> annotationsN)<01>Any)<01>Callable)<01>List)<01>Optional)<01>Tuple)<01>Type<70>)<01>_ET)<01>_ListenerFnType<70>)<01>util)<01> FullArgSpec)<01>_ClsLevelDispatch)<01>_HasEventsDispatch.c<01><00><00><01><02>d<02><01><02>fd<01> }|S)a_legacy sig decorator
:param since: string version for deprecation warning
:param argnames: list of strings, which is *all* arguments that the legacy
version accepted, including arguments that are still there
:param converter: lambda that will accept tuple of this full arg signature
and return tuple of new arg signature.
2025-08-29 00:34:40 +08:00
c<01>j<00><03>t|d<01>sg|_|jj<00><03><01>f<03>|S)N<>_legacy_signatures)<03>hasattrr<00>append)<04>fn<66>argnames<65> converter<65>sinces <20><><EFBFBD><EFBFBD>DD:\pythonpj\aitsc\.venv\Lib\site-packages\sqlalchemy/event/legacy.py<70>legz_legacy_signature.<locals>.leg3s6<00><><00><16>r<EFBFBD>/<2F>0<>$&<26>B<EFBFBD> !<21>
2025-02-23 09:07:52 +08:00
<EFBFBD><1D><1D>$<24>$<24>e<EFBFBD>X<EFBFBD>y<EFBFBD>%A<>B<><11> <09>)r<00>Callable[..., Any]<5D>returnr<00>)rrrrs``` r<00>_legacy_signaturer!#s<00><><00> <12> <0F>Jrc
<01><><00><00><01><05><06><07><08> <09><00>jD]<5D>\<00><08><05><06>ddk(rd<03><07>dd<00>nd<05>t<00><05>t|j<00>k(s<01>;<3B>t|j<00>us<01>Sd<06>j
<00>ddj <00>j<00><00><01>rd nd
<EFBFBD>d <0B>}d <0C>j<00>d <0A>j
<00>d<0E><08>d|<03>d<10> <09> <09><06><11>rJ<00>d<13><06><01><08> fd<11> }|cSd<13><05><00><01><07><08> fd<12> }|cS<00>S)N<><4E><EFBFBD><EFBFBD><EFBFBD>z**kwTrFzdef <20>(<28>, <20>, **kw<6B><00>)z The argument signature for the "<22>.z+" event listener has changed as of version zl, and conversion for the old argument signature will be removed in a future release. The new signature is "<22>"c<01>J<00><04>tj<00><05><04><01><00><02>J<00><00><00>|<00><00>S<00>N)<01>version)r<00>warn_deprecated)<06>args<67>kw<6B>convrr<00> warning_txts <20><><EFBFBD><EFBFBD>r<00>wrap_legz%_wrap_fn_for_legacy.<locals>.wrap_leg`s.<00><><00><18>(<28>(<28><1B>e<EFBFBD>D<><1F>+<2B>+<2B>+<2B><1D>t<EFBFBD>T<EFBFBD>{<7B>+<2B>+rc<01><><00><06>tj<00>
<EFBFBD> <09><01>tt<00>j|<00><00>}<02>D<00>cgc]}||<00><02> }}<03>r<00>|i|<01><01>S<00>|<04>Scc}wr,)rr.<00>dict<63>zip<69> arg_names) r/r0<00>argdict<63>name<6D>args_from_dictr<00>dispatch_collectionr<00>has_kwrr2s <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rr3z%_wrap_fn_for_legacy.<locals>.wrap_leggsg<00><><00><18>(<28>(<28><1B>e<EFBFBD>D<>"<22>3<EFBFBD>':<3A>'D<>'D<>d<EFBFBD>#K<>L<>G<EFBFBD>@H<>%I<><08><04>g<EFBFBD>d<EFBFBD>m<EFBFBD><08>N<EFBFBD>%I<><1D>!<21>><3E>8<>R<EFBFBD>8<>8<>!<21>><3E>2<>2<><32> &Js<00> A)r/rr0rrr) <09>legacy_signatures<65>lenr/<00>bool<6F>varkwr9<00>joinr7<00>clsname)
r;r<00>argspec<65> formatted_defr3rr1r<rr2s
`` @@@@@r<00>_wrap_fn_for_legacyrE<s<><00><><00>
"5<>!F<>!F<><1D><05>x<EFBFBD><14> <13>B<EFBFBD><<3C>6<EFBFBD> !<21><19>F<EFBFBD><1F><01>"<22>~<7E>H<EFBFBD><1A>F<EFBFBD> <0E>x<EFBFBD>=<3D>C<EFBFBD><07> <0C> <0C>-<2D> -<2D>&<26>D<EFBFBD> <13>M<EFBFBD>M<EFBFBD>=
<EFBFBD>3
<EFBFBD>$<24>(<28>(<28><14> <09> <09>-<2D>7<>7<>8<>"<22><08><02>*<2A><0E>M<EFBFBD>(<28>/<2F>/<2F>'<27>,<2C>,<2C><19>!<21> <12> <18><14><1F>!<21>!<21>z<EFBFBD>,<2C>,<2C> <1C>O<EFBFBD>3<>3<><1C>O<EFBFBD>_"G<01>b<12> rc<01>V<00><01>dj<00>fd<02>|jd<01>D<00><00>S)N<>
c3<01>(<00>K<00>|] }<01>|z<00><01><00> y<00>w<01>Nr )<03>.0<EFBFBD>line<6E>indents <20>r<00> <genexpr>z_indent.<locals>.<genexpr>vs<00><><00><><00>@<40>/?<3F>t<EFBFBD>V<EFBFBD>d<EFBFBD>]<5D>/?<3F>s<00>)rA<00>split)<02>textrLs `r<00>_indentrPus!<00><><00> <0F>9<EFBFBD>9<EFBFBD>@<40>t<EFBFBD>z<EFBFBD>z<EFBFBD>$<24>/?<3F>@<40> @<40>@rc<01>F<00>tdjd<02>|jddD<00><00>d<05>}|jrt d<06>|jD<00><00>}nd}d}||rd|znd |j
|j rd
nd d j|j<00>||d <0C>z}|S) NrGc3<01>*K<00>|] }dd|iz<00><01><00> y<02>w)z%(arg)s = kw['%(arg)s']<5D>argNr )rJrSs rrMz+_standard_listen_example.<locals>.<genexpr>s!<00><00><><00>
<EFBFBD>9<><03> &<26><15><03> <0C> 4<>9<>s<00>rr z c3<01>(K<00>|]
\}}}|<01><01><00> y<00>wrIr )rJrr/r1s rrMz+_standard_listen_example.<locals>.<genexpr><3E>s<00><00><><00>
<EFBFBD>%J<>!<21><05>t<EFBFBD>T<EFBFBD> <12>%J<>s<00>z<>from sqlalchemy import event
@event.listens_for(%(sample_target)s, '%(event_name)s')
def receive_%(event_name)s(%(named_event_arguments)s%(has_kw_arguments)s):
"listen for the '%(event_name)s' event"
# ... (event handling logic) ...
z (arguments as of %s)r'r&r%)<06> current_since<63>
event_name<EFBFBD>has_kw_arguments<74>named_event_arguments<74>example_kw_arg<72> sample_target)rPrAr7r=<00>max<61>__name__r<)r;rZrrYrUrOs r<00>_standard_listen_exampler]ys<><00><00>
<1D> <0C> <09> <09>
<EFBFBD>*<2A>4<>4<>Q<EFBFBD>q<EFBFBD>9<>
<EFBFBD>
<EFBFBD> <0F> <06>N<EFBFBD><1B>,<2C>,<2C><1B>
<EFBFBD>%8<>%J<>%J<>
<EFBFBD>
<EFBFBD> <0A>
<1D> <0A> 3<> <09> <09>7D<37> #<23>m<EFBFBD> 3<>"<22><18>k<EFBFBD>k<EFBFBD>(;<3B>(B<>(B<>H<EFBFBD><02>!%<25><19><19>+><3E>+H<>+H<>!I<>(<28>&<26> <06> <06>D<EFBFBD> <10>Krc <01><><00>d}|jD];\}}}|d||j|jrdnddj|<05>|d<05>zz }<03>=|S)Nr'a&
# DEPRECATED calling style (pre-%(since)s, will be removed in a future release)
@event.listens_for(%(sample_target)s, '%(event_name)s')
def receive_%(event_name)s(%(named_event_arguments)s%(has_kw_arguments)s):
"listen for the '%(event_name)s' event"
# ... (event handling logic) ...
z **kwr%)rrVrWrXrZ)r=r\r<rA)r;rZrrOrr/r1s r<00>_legacy_listen_examplesr_<00>sh<00><00>
<0E>D<EFBFBD>0<>B<>B<><19><05>t<EFBFBD>T<EFBFBD> <0C> 7<><1F> <20>k<EFBFBD>k<EFBFBD>2<>9<>9<>G<EFBFBD>r<EFBFBD>)-<2D><19><19>4<EFBFBD><1F>!.<2E><0E> <0E>
<EFBFBD><04>C<01>& <10>Krc<01><><00><00><01><00>jd\}}}d|<02>j<00>jdj<00><01>fd<04><08>jD<00><00><00>j
rdd<07>zSdd<07>zS)Nra=
.. versionchanged:: %(since)s
The :meth:`.%(clsname)s.%(event_name)s` event now accepts the
arguments %(named_event_arguments)s%(has_kw_arguments)s.
Support for listener functions which accept the previous
argument signature(s) listed above as "deprecated" will be
removed in a future release.r%c3<01>X<00>K<00>|]!}d<00>j<00>j|d<01>z<00><01><00>#y<02>w)z6:paramref:`.%(clsname)s.%(event_name)s.%(param_name)s`)rBrV<00>
param_nameN)r\r9)rJrbr;<00>parent_dispatch_clss <20><>rrMz-_version_signature_changes.<locals>.<genexpr><3E>s?<00><><00><><00>/<0E>#@<01>J<EFBFBD> I<01>2<>;<3B>;<3B>"5<>":<3A>":<3A>",<2C><12><12> #@<01>s<00>'*r&r')rrBrVrXrW)r=r\r9rAr7r<)rcr;rr/r1s`` r<00>_version_signature_changesrd<00>s<><00><><00>,<2C>=<3D>=<3D>a<EFBFBD>@<40><15>E<EFBFBD>4<EFBFBD><14> +<2B><1B>*<2A>3<>3<>-<2D>2<>2<>%)<29>Y<EFBFBD>Y<EFBFBD>/<0E>#6<>"?<3F>"?<3F>/<0E>&<0E>-@<01>,F<>,F<><08>
<EFBFBD> 
<EFBFBD><06>(MO<01>
<EFBFBD> 
<EFBFBD>rc<01><00>d}t|dd<03>}|tt|||<02>d<04>z}|jr)|tt |||<02>d<04>z }|t ||<00>z }t j|j|d<05>S)Nz@.. container:: event_signatures
Example argument forms::
<EFBFBD>_target_class_doc<6F>objz r
) <09>getattrrPr]r=r_rdr<00>inject_docstring_text<78>__doc__)r;rcr<00>headerrZrOs r<00>_augment_fn_docsrl<00>s<><00><00>  <0A> <0B> <1C>/<2F>1D<31>e<EFBFBD>L<>M<EFBFBD> <11>G<EFBFBD> <20>!4<>m<EFBFBD>R<EFBFBD>H<><0F><06> <06>D<EFBFBD><1B>,<2C>,<2C> <0C><07> #<23>$7<><1D><02> K<> <13>
<EFBFBD>
<EFBFBD><04>
<0A>*<2A> <1F>!4<>
<EFBFBD>
<EFBFBD><04> <10> %<25> %<25>b<EFBFBD>j<EFBFBD>j<EFBFBD>$<24><01> :<3A>:rrI)r<00>strrz List[str]rzOptional[Callable[..., Any]]rz2Callable[[Callable[..., Any]], Callable[..., Any]])r;<00>_ClsLevelDispatch[_ET]rr rCrrr )rOrmrLrmrrm)r;rnrZrrr rrm)r;rnrZrmrr rrm)rc<00>Type[_HasEventsDispatch[_ET]]r;rnrrm)r;rnrcrorr rrm)rj<00>
__future__r<00>typingrrrrrr <00>registryr r r'r<00> util.compatr<00> TYPE_CHECKING<4E>attrr<00>baserrm<00>_LegacySignatureTyper!rErPr]r_rdrlr rr<00><module>rxs^<00><01><04>#<23> <0A><16><1B><17><1B><18><17><19>%<25><13>%<25> <09><17><17>'<27>(<28><1D>S<EFBFBD>$<24>s<EFBFBD>)<29>X<EFBFBD>h<EFBFBD>s<EFBFBD>C<EFBFBD>x<EFBFBD>6H<36>-I<>I<>J<><14> /3<><0F> <0E><0F><17><0F>,<2C><0F>8<> <0F>26<12>/<2F>6<12><17>6<12><19>6<12><15> 6<12>rA<01>&<10>/<2F>&<10><16>&<10> <18>&<10> <09> &<10>R<10>/<2F><10><16><10> <18><10> <09> <10>8<06>6<><06>/<2F><06> <09><06><;<3B>/<2F>;<3B>6<>;<3B> <18>;<3B> <09> ;r