
    ng\jgR                        % S SK r S SKJrJr  S SKJrJr  S SKJrJ	r	J
r
JrJrJr  S SKJrJrJrJrJrJrJrJr  S SKJrJr  SSKJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,  SS	KJ-r-  S
SK.J/r/  S
SK0J1r1J2r2  Sr3Sr4Sr5Sr6\\S.r7S\#0r8\ Rr                  " \:5      r; " S S\5      r< " S S\<5      r= " S S\<5      r> " S S5      r?Sr@SrASrBSrCSrDS rES!rFS"rG\B\C\D\E\F4rH\B\\?R                  4\C\\?R                  4\D\\?R                  4\E\\?R                  4\A\\?R                  4\F\\?R                  4\G\\?R                  40rN\O\P\Q\R\   \	4   4   \SS#'    " S$ S%\5      rT " S& S'\5      rU " S( S)\>5      rVg)*    N)ABCabstractmethod)IncompleteReadErrorStreamReader)	AwaitableCallableListOptionalProtocolUnion)MaintenanceNotificationNodeFailedOverNotificationNodeFailingOverNotificationNodeMigratedNotificationNodeMigratingNotificationNodeMovingNotificationOSSNodeMigratedNotificationOSSNodeMigratingNotification)deprecated_functionsafe_str   )AskErrorAuthenticationError$AuthenticationWrongNumberOfArgsErrorBusyLoadingErrorClusterCrossSlotErrorClusterDownErrorConnectionErrorExecAbortErrorExternalAuthProviderErrorMasterDownErrorModuleError
MovedErrorNoPermissionErrorNoScriptErrorOutOfMemoryErrorReadOnlyErrorResponseErrorTryAgainError)
EncodableT   )Encoder)SERVER_CLOSED_CONNECTION_ERRORSocketBufferz:Error loading the extension. Please check the server logs.z5Error unloading module: no such module with that namez/Error unloading module: operation not possible.z[Error unloading module: the module exports one or more module-side data types, can't unload)zxAUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?z(Client sent AUTH, but no password is setzproblem with LDAP servicec                       \ rS rSrS\S\S\S\\\\	\\
\\\0\E\E\\\\\\\\\\\\\\S.r\S 5       r\S 5       r\S	 5       rS
r g)
BaseParserC   zmax number of clients reachedzinvalid passwordz,wrong number of arguments for 'auth' commandz,wrong number of arguments for 'AUTH' command)ERROOM	WRONGPASS	EXECABORTLOADINGNOSCRIPTREADONLYNOAUTHNOPERMASKTRYAGAINMOVEDCLUSTERDOWN	CROSSSLOT
MASTERDOWNc                     UR                  S5      S   nX R                  ;   aQ  U[        U5      S-   S nU R                  U   n[        U[        5      (       a  UR                  U[        5      nU" XS9$ [        U5      $ )zParse an error response r   r+   N)status_code)splitEXCEPTION_CLASSESlen
isinstancedictgetr(   )clsresponse
error_codeexception_classs       N/home/edenadmin/noVNC/venv/lib/python3.13/site-packages/redis/_parsers/base.pyparse_errorBaseParser.parse_errorg   s~     ^^C(+
...J! 3 56H!33J?O/400"1"5"5h"N"8DDX&&    c                     g N selfs    rN   on_disconnectBaseParser.on_disconnects       rQ   c                     g rS   rT   rV   
connections     rN   
on_connectBaseParser.on_connectw   rY   rQ   rT   N)!__name__
__module____qualname____firstlineno__r   r   r   MODULE_LOAD_ERRORr"   MODULE_EXPORTS_DATA_TYPES_ERRORNO_SUCH_MODULE_ERROR MODULE_UNLOAD_NOT_POSSIBLE_ERRORNO_AUTH_SET_ERROREXTERNAL_AUTH_PROVIDER_ERRORr&   r   r   r%   r'   r$   r   r)   r#   r   r   r!   rE   classmethodrO   r   rW   r]   __static_attributes__rT   rQ   rN   r0   r0   C   s     ,_ 3!"F!"F{+[ +,k
  
  +!
$  (##!!%#!'*%A!F 	' 	'    rQ   r0   c                   F    \ rS rSrSrS rS rS rS rSS\	S\
4S	 jjrS
rg)	_RESPBase|   z&Base class for sync-based resp parsingc                 :    Xl         S U l        S U l        S U l        g rS   )socket_read_sizeencoder_sock_bufferrV   ro   s     rN   __init___RESPBase.__init__   s     0
rQ   c                 F     U R                  5         g ! [         a     g f = frS   )rW   	ExceptionrU   s    rN   __del___RESPBase.__del__   s%    	  		s    
  c                     UR                   U l         [        U R                   U R                  UR                  5      U l        UR
                  U l        g)zCalled when the socket connectsN)rq   r.   ro   socket_timeoutrr   rp   r[   s     rN   r]   _RESPBase.on_connect   sA    %%
#JJ--z/H/H
 "))rQ   c                 |    SU l         U R                  b!  U R                  R                  5         SU l        SU l        g)z"Called when the socket disconnectsN)rq   rr   closerp   rU   s    rN   rW   _RESPBase.on_disconnect   s1    
<<#LL DLrQ   timeoutreturnc                 T    U R                   c  gU R                   R                  U5      $ )NF)rr   can_read)rV   r   s     rN   r   _RESPBase.can_read   s&     <<||$$W--rQ   )rr   rq   rp   ro   N)r   )r_   r`   ra   rb   __doc__rt   rx   r]   rW   floatboolr   rj   rT   rQ   rN   rl   rl   |   s1    0*. .d . .rQ   rl   c            
           \ rS rSrSrSrS\4S jr\" SSSS	9\	S
\
4S j5       5       r\	S
\
4S j5       r SS\
S
\\\S\\   4   4S jjrSrg)AsyncBaseParser   z5Base parsing class for the python-backed async parser_stream
_read_sizero   c                     S U l         Xl        g rS   r   rs   s     rN   rt   AsyncBaseParser.__init__   s    /3*rQ   8.0.0Use can_read() insteadcan_read_destructiveversionreasonnamer   c                    #    g 7frS   rT   rU   s    rN   r   $AsyncBaseParser.can_read_destructive   s
     
 	   c                    #    g 7frS   rT   rU   s    rN   r   AsyncBaseParser.can_read   s
      	r   disable_decodingNc                    #    [        5       e7frS   NotImplementedError)rV   r   s     rN   read_responseAsyncBaseParser.read_response   s      "##   )r   r   )F)r_   r`   ra   rb   r   	__slots__intrt   r   r   r   r   r   r   r*   r(   r	   r   rj   rT   rQ   rN   r   r      s    ?'I+ +  8?U D      (-$ $$	z=$Z0@@	A$ $rQ   r   c                   h    \ rS rSrSr\S 5       r\S 5       r\S 5       r\S 5       r	\S 5       r
Srg	)
MaintenanceNotificationsParser   zEProtocol defining maintenance push notification parsing functionalityc                 >    U S   n[        U S   5      n[        X5      $ Nr+   r   )r   r   )rK   idslotss      rN   parse_oss_maintenance_start_msg>MaintenanceNotificationsParser.parse_oss_maintenance_start_msg   s&     a[!%+B66rQ   c                     U S   nU S   n0 nU HD  u  pEn[        U5      n[        U5      n[        U5      n	Xs;  a  / X7'   X7   R                  X05        MF     [        X5      $ r   )r   appendr   )
rK   r   nodes_to_slots_mapping_datanodes_to_slots_mappingsrc_node	dest_noder   src_node_strdest_node_str	slots_strs
             rN   #parse_oss_maintenance_completed_msgBMaintenanceNotificationsParser.parse_oss_maintenance_completed_msg   s|     a[&.qk# "$*E&H#H-L$Y/M I979&4"0778RS +F +2FFrQ   c                 &    U S   nU S   nU" X#5      $ r   rT   )rK   notification_typer   ttls       rN   parse_maintenance_start_msg:MaintenanceNotificationsParser.parse_maintenance_start_msg   s!     a[qk ))rQ   c                     U S   nU" U5      $ )Nr+   rT   )rK   r   r   s      rN   parse_maintenance_completed_msg>MaintenanceNotificationsParser.parse_maintenance_completed_msg   s     a[ $$rQ   c                     U S   nU S   nU S   c  Su  p4O1[        U S   5      nUR                  S5      u  p4Ub  [        U5      OS n[        XXB5      $ )Nr+   r      )NN:)r   rD   r   r   )rK   r   r   hostportvalues         rN   parse_moving_msg/MaintenanceNotificationsParser.parse_moving_msg   sd     a[qkA;#JD$Xa[)ES)JD $ 03t9dD%b::rQ   rT   N)r_   r`   ra   rb   r   staticmethodr   r   r   r   r   rj   rT   rQ   rN   r   r      si    O7 7 G G2 * * % % ; ;rQ   r   
invalidateMOVING	MIGRATINGMIGRATEDFAILING_OVERFAILED_OVER
SMIGRATING	SMIGRATED-MSG_TYPE_TO_MAINT_NOTIFICATION_PARSER_MAPPINGc                       \ rS rSr% Sr\\S'   Sr\\   \S'   Sr	\\   \S'   Sr
\\   \S'   Sr\\   \S'   S	 rS
 rS rS rS rS rS rSrg)PushNotificationsParseri9  z6Protocol defining RESP3-specific parsing functionalitypubsub_push_handler_funcNinvalidation_push_handler_funcnode_moving_push_handler_funcmaintenance_push_handler_func#oss_cluster_maint_push_handler_funcc                     [        5       e)zHandle pubsub push responsesr   rV   rK   s     rN   handle_pubsub_push_response3PushNotificationsParser.handle_pubsub_push_responseB  s    !##rQ   c                    US   n[        U[        5      (       a  UR                  5       nU[        /[        Q[
        P[        P7;  a  U R                  U5      $  U[        :X  a"  U R                  (       a  U R                  U5      $ U[
        :X  a6  U R                  (       a%  [        U   S   nU" U5      nU R                  U5      $ U[        ;   aX  U R                  (       aG  [        U   S   nU[        :X  a	  U" U5      nO[        U   S   nU" X5      nUb  U R                  U5      $ U[        :X  a}  U R                  (       d  U R                  (       a[  [        U   S   nU" U5      nUbD  U R                  (       a  U R                  U5        U R                  (       a  U R                  U5        g ! [         a/  n[        R!                  SR#                  X1U5      5         S nAg S nAff = f)Nr   r+   "Error handling {} message ({}): {}rG   bytesdecode_INVALIDATION_MESSAGE_MAINTENANCE_MESSAGES_MOVING_MESSAGE_SMIGRATED_MESSAGEr   r   r   r   r   _SMIGRATING_MESSAGEr   rw   loggererrorformatrV   rK   kwargsmsg_typeparser_functionnotificationr   es           rN   handle_push_response,PushNotificationsParser.handle_push_responseF  s   A;h&&(H!
"
 
 	
 
 00::.	1177::8DD?*t/Q/Q"O##  /x899,GG00T5W5W"O## 22#28#<L(U ))% $38#OL+==lKK--8855"O##  /x8+99::<H??@@N   	LL4;;HPQR  	s,   +F1 ?F1 A!F1 )BF1 1
G*;%G%%G*c                     Xl         g rS   r   rV   r   s     rN   set_pubsub_push_handler/PushNotificationsParser.set_pubsub_push_handler  s    (@%rQ   c                     Xl         g rS   r   rV   r   s     rN   set_invalidation_push_handler5PushNotificationsParser.set_invalidation_push_handler  s    .L+rQ   c                     Xl         g rS   r   rV   r   s     rN   set_node_moving_push_handler4PushNotificationsParser.set_node_moving_push_handler      -J*rQ   c                     Xl         g rS   r   rV   r   s     rN   set_maintenance_push_handler4PushNotificationsParser.set_maintenance_push_handler  r  rQ   c                     Xl         g rS   r   rV   r   s     rN   "set_oss_cluster_maint_push_handler:PushNotificationsParser.set_oss_cluster_maint_push_handler      3V0rQ   r   r   r   r   r   )r_   r`   ra   rb   r   r   __annotations__r   r
   r   r   r   r   r   r   r   r   r  r  rj   rT   rQ   rN   r   r   9  st    @&&9="HX$6=8<!8H#5<8<!8H#5<>B'();B$=~AMKKWrQ   r   c                       \ rS rSr% Sr\\S'   Sr\\   \S'   Sr	\\S\
S   4      \S'   Sr\\S\
S   4      \S'   Sr\\S\
S   4      \S	'   S
 rS rS rS rS rS rS rSrg)AsyncPushNotificationsParseri  z<Protocol defining async RESP3-specific parsing functionalityr   Nr   .r   r   r   c                    #    [        5       e7f)z+Handle pubsub push responses asynchronouslyr   r   s     rN   r   8AsyncPushNotificationsParser.handle_pubsub_push_response  s     !##r   c                   #    US   n[        U[        5      (       a  UR                  5       nU[        /[        Q[
        P[        P7;  a  U R                  U5      I Sh  vN $  U[        :X  a*  U R                  (       a  U R                  U5      I Sh  vN $ [        U[        5      (       a  UR                  5       nU[
        :X  a>  U R                  (       a-  [        U   S   nU" U5      nU R                  U5      I Sh  vN $ U[        ;   a`  U R                  (       aO  [        U   S   nU[        :X  a	  U" U5      nO[        U   S   nU" X5      nUb  U R                  U5      I Sh  vN $ U[        :X  aA  U R                  (       a0  [        U   S   nU" U5      nUb  U R                  U5      I Sh  vN $ g GN] GN+ N NX N! [         a/  n[        R!                  SR#                  X1U5      5         SnAgSnAff = f7f)z$Handle push responses asynchronouslyr   Nr+   r   r   r   s           rN   r   1AsyncPushNotificationsParser.handle_push_response  s     A;h&&(H!
"
 
 	
 
 66x@@@,	1177!@@JJJ(E**#??,?*t/Q/Q"O##  /x8!??MMM00T5W5W"O## 22#28#<L(U ))% $38#OL+!%!C!CL!QQQ..<<"O##  /x8+!%!I!I,!WWW a A K N R X 	LL4;;HPQR  	s   AHF< H%/G F?G HA(G GG HA%G +G,G /H0AG 6G7G :H?G G G G 
H%G<7H<HHc                     Xl         g)z$Set the pubsub push handler functionNr   r   s     rN   r   4AsyncPushNotificationsParser.set_pubsub_push_handler  s    (@%rQ   c                     Xl         g)z*Set the invalidation push handler functionNr   r   s     rN   r   :AsyncPushNotificationsParser.set_invalidation_push_handler  s    .L+rQ   c                     Xl         g rS   r   r   s     rN   r   9AsyncPushNotificationsParser.set_node_moving_push_handler  r  rQ   c                     Xl         g rS   r  r  s     rN   r  9AsyncPushNotificationsParser.set_maintenance_push_handler  r  rQ   c                     Xl         g rS   r	  r
  s     rN   r  ?AsyncPushNotificationsParser.set_oss_cluster_maint_push_handler  r  rQ   r  )r_   r`   ra   rb   r   r   r  r   r
   r   r   r   r   r   r   r   r   r   r  r  rj   rT   rQ   rN   r  r    s    F&&9="HX$6=NR!8HS)D/5I,J#KRNR!8HS)D/5I,J#KRTX'(3	$;O2P)QX$=~AMKKWrQ   r  c                      ^  \ rS rSrSr\R                  S-   rS\4U 4S jjrS r	S r
S r\" S	S
SS9S\4S j5       rS\4S jrS\S\4S jrS\4S jrSrU =r$ )_AsyncRESPBasei  z!Base class for async resp parsing)rp   rr   _pos_chunksro   c                 \   > [         TU ]  U5        S U l        SU l        / U l        SU l        g )NrQ   r   )superrt   rp   rr   r#  r"  )rV   ro   	__class__s     rN   rt   _AsyncRESPBase.__init__  s-    )**.	rQ   c                 F    SU l         U R                  R                  5         g )NrQ   )rr   r#  clearrU   s    rN   _clear_AsyncRESPBase._clear  s    rQ   c                     UR                   U l        U R                  c  [        [        5      eUR                  U l        U R                  5         SU l        g)zCalled when the stream connectsNT)_readerr   r   r-   rp   r*  
_connectedr[   s     rN   r]   _AsyncRESPBase.on_connect  sB    !))<<!"@AA!))rQ   c                     SU l         g)z"Called when the stream disconnectsFN)r.  rU   s    rN   rW   _AsyncRESPBase.on_disconnect  s	    rQ   r   r   r   r   r   c                 >   #    U R                  5       I S h  vN $  N7frS   )r   rU   s    rN   r   #_AsyncRESPBase.can_read_destructive  s      ]]_$$$s   c                    #    U R                   (       d  [        S5      eU R                  (       a  g[        U R                  R                  5      =(       d    U R                  R                  5       $ 7f)NzBuffer is closed.T)r.  OSErrorrr   r   r   at_eofrU   s    rN   r   _AsyncRESPBase.can_read  sM      -..<< DLL(()BT\\-@-@-BBs   A/A1lengthc                   #    US-   nU R                   U-   n[        U R                  5      U:  a  U R                  U R                   US-
   nOkU R                  U R                   S n U R                  R	                  U[        U5      -
  5      I Sh  vN nXV-   SS nU R                  R                  U5        U =R                   U-  sl         U$  N=! [
         a  n[        [        5      UeSnAff = f7f)z
        Read `length` bytes of data.  These are assumed to be followed
        by a '
' terminator which is subsequently discarded.
        r   N)
r"  rF   rr   r   readexactlyr   r   r-   r#  r   )rV   r8  wantendresulttaildatar   s           rN   _read_AsyncRESPBase._read$  s     
 zii$t||#\\$))cAg6F<<		,DQ!\\55dSY6FGG k3B'FLL%		T	 H& Q%&DE5PQs<   A$C3'*C CC 9C3C 
C0C++C00C3c                   #    U R                   R                  SU R                  5      nUS:  a  U R                   U R                  U nOU R                   U R                  S nU R                  R	                  5       I Sh  vN nUR                  S5      (       d  [        [        5      eX4-   SS nU R                  R                  U5        U =R                  [        U5      S-   -  sl        U$  Nn7f)zq
        read an unknown number of bytes up to the next '
'
        line separator, which is discarded.
        s   
r   Nr:  r   )rr   findr"  r   readlineendswithr   r-   r#  r   rF   )rV   foundr>  r?  r@  s        rN   	_readline_AsyncRESPBase._readline8  s     
 !!'4995A:\\$))e4F<<		,D..00D==))%&DEEk3B'FLL%		S[1_$	 1s   A=C0?C. A/C0)rr   r#  r.  r"  r   rp   )r_   r`   ra   rb   r   r   r   r   rt   r*  r]   rW   r   r   r   r   r   rA  rH  rj   __classcell__)r&  s   @rN   r!  r!    s    +)),UUI   '#
%D %
%
C 
C# % (  rQ   r!  )Wloggingabcr   r   asyncior   r   typingr   r   r	   r
   r   r   redis.maint_notificationsr   r   r   r   r   r   r   r   redis.utilsr   r   
exceptionsr   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   encodersr,   socketr-   r.   rc   re   rf   rd   rg   rh   	getLoggerr_   r   r0   rl   r   r   r   r   _MIGRATING_MESSAGE_MIGRATED_MESSAGE_FAILING_OVER_MESSAGE_FAILED_OVER_MESSAGEr   r   r   r   r   r   r   r   r   rH   strtupletyper  r   r  r!  rT   rQ   rN   <module>r\     s    # 5 G G	 	 	 6    (    @P N #T     ':0C   !:   
		8	$6 6r$.
 $.N$j $8D; D;N %    & $ "      !&BB  &FF #&BB "&FF &77 $&FF #&JJ3 .tt+,h6	770 DYWh YWx[W8 [W|U_ UrQ   