df dZddlmZGddeZeZeZeZeZ eZ GddeZdS)z. Provide django-style hooks for model events. )Modelc8eZdZdZdZddZd dZddZdZdS) Signalc.|dSN)_flushselfs q/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/playhouse/signals.py__init__zSignal.__init__s c:t|_g|_dSr)set _receivers_receiver_listr s r rz Signal._flush s%% r Nc|p|j}||f}||jvr9|j||j|||fdSt d|d|pdd)Nreceiver named z (for sender=anyz) already connected)__name__raddrappend ValueErrorr receivernamesenderkeys r connectzSignal.connects(x(Vn do % % O   $ $ $   & &h'? @ @ @ @ @*,0DD&/E//CDD Dr c|r p|jstdf}||jvrtddpdd|j|fd|jD|_dS)Nz%a receiver or a name must be providedrz for sender=rz not found.c:g|]\}}}|k |k|||fSr!).0nrsrrs r z%Signal.disconnect..%s====WQ1"#t))V !"1ay0; r )rrrremoverrs `` r disconnectzSignal.disconnects  -,8,D FDEE EVn do % %*"ddFOeOO566 6 s###=====8K===r cfd}|S)Nc6||Sr)r)fnrr rs r decoratorz"Signal.__call__..decorator)s LLT6 * * *Ir r!)r rrr,s``` r __call__zSignal.__call__(s0       r c t|}g}|jD]:\}}}|t||r"|||||g|Ri|f;|Sr)typer isinstancer) r instanceargskwargsr responsesr#r$r%s r sendz Signal.send.s{h * L LGAq!yJx33y  !QQvx%I$%I%I%I&%I%I!JKKKr )NN)NNN) r __module__ __qualname__r rrr(r-r5r!r r rrs!!!DDDD = = = = r rc2eZdZfdZfdZfdZxZS)rc|tt|j|i|t|dSr)superrr pre_initr5)r r2r3 __class__s r r zModel.__init__?s=#eT#T4V444 dr c.|jjr|jnd}|ddpt | }t ||tt|j |i|}t|||S)NT force_insertF)created) _meta primary_key_pkgetboolpre_saver5r:rsave post_save)r r2r3pk_valuer?retr<s r rFz Model.saveCs#z5?4884**^U33I4>>7I dG ,,,%eE4  %t6v66tW--- r ct|tt|j|i|}t ||Sr) pre_deleter5r:rdelete_instance post_delete)r r2r3rIr<s r rLzModel.delete_instanceKsO0eE4  0$A&AA r )rr6r7r rFrL __classcell__)r<s@r rr>sjr rN) __doc__peeweer_ModelobjectrrErGrKrMr;r!r r rSs#"""""-----V---` 688 FHH VXX fhh 688Fr