+
    QDbfK  c                   s   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ]P                  ! RR4       ^ RIHt ]P                  ! RR4       ^ RIH	t	 ^ RI
t
^ RI5 ^ RI5 ^ RIt]P                  ! ]P                  ]P                   R	7       R
 t]P$                  ! R4        ! R R]	P&                  4      t ! R R4      t]! 4       t ! R R4      t]R8X  d{   ]P2                  ! 4        ^ RIHt ]! R4       ]! ]RR7      P;                  4       t]! R4       ]PA                  R4       ]!! ]! ]PD                  RR7      P;                  4       4       R# R# )    N)GLibGdkz3.0)r   Gtk)r   )Z*)domain	localedirc                 s    V # N )x   &,/usr/share/system-config-printer/authconn.py<lambda>r   #   s    q    z1.9.60c                   s0  a  ] tR t^&t o R]! R4      R]! R4      R]! R4      /tRR]P                  P                  ]P                  ]P                  P                  ]P                  ]P                  P                  3RR3R	 ltR
 tR tR tR tR tRtV tR# )
AuthDialogusernamez	Username:passwordz	Password:r   zDomain:NFc           	     sV   Vf   \        R4      pVf   RR.p\        P                  P                  WW#V4       WPn        V P                  \        P                  P                  4       V P                  ^4       V P                  R4       \        P                  P                  R^4      pVP                  ^4       \        P                  ! 4       pVP                  \        P                  \        P                  P                   4       VP#                  RR4       VP%                  VRR^ 4       \        P&                  P                  R^4      p	\        P(                  ! 4       V n        V	P%                  V P*                  RR^ 4       \-        V4      p
\        P.                  ! 4       pVP1                  V
4       VP3                  ^4       VP5                  ^4       VP7                  ^4       . V n        \;        V
4       F  pW\,          p\        P(                  ! \        V P<                  P?                  W4      4      R7      pVP#                  ^ R4       VPA                  V^ V^^4       \        PB                  ! 4       pVPE                  VR8g  4       VPA                  V^V^^4       V P8                  PG                  V4       K  	  V P8                  V
^,
          ,          PI                  R4       V	P%                  VRR^ 4       VP%                  V	RR^ 4       V PJ                  P%                  VRR^ 4       V'       dU   \        PL                  PO                  \        R	4      4      pVPQ                  R4       V	P%                  VRR^ 4       VV n)        V PJ                  PU                  4        R # )
NAuthenticationr   r   Fg        )labelg      ?TzRemember password)+_r   Dialog__init__auth_info_requiredset_default_responseResponseTypeOKZset_border_widthZset_resizableZHBoxZnewZImageZset_from_stockZSTOCK_DIALOG_AUTHENTICATIONZIconSizeZDIALOGset_alignmentZ
pack_startZVBoxZLabelprompt_labellenZGridZ
insert_rowZinsert_columnZset_row_spacingZset_column_spacingfield_entryrange
AUTH_FIELDZgetZattachZEntryZset_visibilityappendZset_activates_defaultvboxZCheckButtonZnew_with_labelZ
set_activeremember_checkboxshow_all)selftitleparentZflagsbuttonsr   Zallow_rememberZhboxZimager    Z
num_fieldsZgridifieldr   ZentryZcbs   &&&&&&&          r
   r   ZAuthDialog.__init__+   s    =&'E%",j!9

T&A"4!!3#3#3#6#67q!E"xx||UB'q!		c==!ll11	3S#&ua0xx||UB'IIL**E5!<,-
xxz
#1a #
#A&)EIIQt':':E'I%JKEC(KK1a+IILE  %:"56KK1a+##U+ $ 	a(>>EueQ/ueQ/		dE5!4//3F1GHBMM5!OORq1%'D"		r   c                s    V P                   P                  R V,           R,           4       V P                   P                  R4       V P                   P                  ^ ^ 4       V P                   P	                  R4       R# )"<span weight="bold" size="larger">z</span>TN)r   
set_markupZset_use_markupr   Zset_line_wrapr#   Zprompt   &&r
   
set_promptZAuthDialog.set_promptd   sg    $$&J&,'-/8'9 	:(($/''A.''.r   c                s    \        \        V P                  4      4       F+  pV P                  V,          P                  W,          4       K-  	  R # r   )r   r   r   Zset_text)r#   Z	auth_infor'      && r
   set_auth_infoZAuthDialog.set_auth_infok   s7    T--./AQ((),7 0r   c                s^    V P                    Uu. uF  qP                  4       NK  	  up# u upi r   )r   Zget_text)r#   r      & r
   get_auth_infoZAuthDialog.get_auth_infoo   s&    '+'7'78'7!

'7888s   *c                s\     V P                   P                  4       #   \         d     R # i ; iF)r!   Z
get_activeZAttributeErrorr#   r	   r
   get_remember_passwordZ AuthDialog.get_remember_passwordr   s.    	))4477 		s    ++c                s~    V P                   P                  V4      pV P                  V,          P                  4        R # r   )r   Zindexr   Z
grab_focus)r#   r(   r'   r.   r
   field_grab_focusZAuthDialog.field_grab_focusx   s/    ##))51&&)r   )r   r   r   r!   )__name__
__module____qualname____firstlineno__N_r   r   ZDialogFlagsZMODALSTOCK_CANCELr   CANCELZSTOCK_OKr   r   r-   r/   r1   r4   r5   __static_attributes____classdictcell__Z__classdict__   @r
   r   r   &   s     B{OB{O"Y-)J #4--++S-=-=-D-D<<)9)9)<)<>%)!&7r/89* *r   r   c                   sD   a  ] tR t^t o R tRR ltRR ltRR ltRtV t	R# )_AuthInfoCachec                s$    \        4       V n        R # r   )Zdictcredsr3   r	   r
   r   Z_AuthInfoCache.__init__   s    V
r   Nc                s0    Vf   RpWP                   W#3&   R # Niw  rB   )r#   Zdatahostports   &&&&r
   cache_auth_infoZ_AuthInfoCache.cache_auth_info   s    <D"&

D;r   c                s\    Vf   Rp V P                   W3,          #   \         d     R # i ; irC   rB   ZKeyErrorr#   rE   rF      &&&r
   lookup_auth_infoZ_AuthInfoCache.lookup_auth_info   s4    <D	::tk** 		s    ++c                sT    Vf   Rp V P                   W3 R #   \         d     R # i ; irC   rH   rI   rJ   r
   remove_auth_infoZ_AuthInfoCache.remove_auth_info   s1    <D	

D;' 		s    ''rD   )NN)
r6   r7   r8   r9   r   rG   rK   rL   r=   r>   r?   r@   r
   rA   rA      s     ' r   rA   c                   s   a  ] tR t^t o RR ltR tR tR tR tR t	RR lt
R	 tR
 tR tR tR tRR ltR tR tR tR tR tR tRtV tR# )
ConnectionNc                s   Ve   \         P                  ! V4       Ve   \         P                  ! V4       Ve   \         P                  ! V4       RV n        Wn        W n        \         P                  ! 4       V n        \         P                  ! 4       V n
        \         P                  ! 4       V n        \         P                  ! 4       V n        RV n        . V n        W0n        \$        P&                  ! 4       V n        V P+                  4        R # )N T)cupsZ	setServerZsetPortZsetEncryption_use_password_parent_try_as_rootZgetUser	_use_userZ	getServer_serverZgetPort_portZgetEncryption_encryption_prompt_allowed_operation_stack_lock	threadingZEvent
_gui_event_connect)r#   r%   Ztry_as_rootZlockrE   rF   
encryptions   &&&&&&&r
   r   ZConnection.__init__   s    NND!LL$!
+'~~(\\^
--0# "
#//,r   c                s`    \        V : R V: 24       V P                  P                  V4       R# )z: Operation += N)
debugprintrX   r   )r#   Z	operationr,   r
   _begin_operationZConnection._begin_operation   s#    T9=>$$i0r   c                s^    \        R V ,          4       V P                  P                  4        R# )z%s: Operation endedN)r^   rX   popr3   r	   r
   _end_operationZConnection._end_operation   s"    )D01!!$r   c                s    V P                   # r   rW   r3   r	   r
   _get_prompt_allowedZConnection._get_prompt_allowed   s    ###r   c                    Wn         R # r   rb   )r#   Zallowedr,   r
   _set_prompt_allowedZConnection._set_prompt_allowed   s    &r   c                rd   r   )rY   )r#   Zwhetherr,   r
   	_set_lockZConnection._set_lock   s    
r   c           	     s   \         P                  ! V P                  4       T;'       dN    V P                  ^ ,          R8H  ;'       g    V P                  R8H  ;'       d    \        P
                  ! 4       ^ 8g  V n        V P                  '       d   \        P                  pM\         P                  pV! V P                  V P                  V P                  R7      V n        V P                  '       d&   V P                  P                  V P                  4       V P                  V n        \        RV P                  ,          4       \!        V P                  P"                  4      p\!        V P                  P$                  4      p\'        V P                  4       FW  pV^ ,          R8X  d   K  \)        V P                  V4      p\!        V4      W439   g   K<  \+        WV P-                  WV4      4       KY  	  R# )r    /Z	localhost)rE   rF   r]   zConnected as user %sr   N)rO   setUserrS   rT   osZgetuid_use_pkcupspkrM   rU   rV   _connectionZ
set_parentrQ   _userr^   ZtypeZgetPrintersZ
addPrinterZdirgetattrZsetattr_make_binding)r#   allow_pkZcreate_objectZmethodtype_lambdaZmethodtype_realfnamefns   &&     r
   r\   ZConnection._connect   sl   dnn%  . .aC/NN4<<;3N. .IILA- 	 <<<"--M OOM(t||157;7G7GI <<<''5^^
*TZZ78 $"2"2">">? 0 0 ; ;<$**+EQx3$**E2B9!2 DDT$"4"4e"@A ,r   c                sJ    \        V P                  \        P                  4      # r   )Z
isinstancerl   rk   rM   r3   r	   r
   _using_polkitZConnection._using_polkit   s    4++V->->??r   c                s   a aa VVV 3R  l# )c                  s2   < SP                   ! SS.V O5/ VB # r   )	_authloop)argskwdsrr   rq   r#   s   *,r
   r   Z*Connection._make_binding.<locals>.<lambda>   s    T^^UB%N%N%Nr   r   )r#   rq   rr   s   fffr
   ro   ZConnection._make_binding   s	    NNr   c                s`   ^ V n         V P                  4       '       g   VP                  RR4       V P                  pRp  V P	                  4       ^ 8X  d    X# WPP                  8w  d#   \        V P                  V4      pV P                  p\        P                  ! V P                  4       VP                  ! V/ VB pVR8X  d-   V/ 8X  d&   \        P                  ! \        P                  R4      h V#   \        P                   EdD   pTP                  w  rT P                  '       d(   T	R8X  d!   \        P                  ! ^ \        R4      4      hT P                  '       gi   T\        P                  8X  g+   T\        P                   8X  g   T\        P"                  8X  d*   T P%                  T\        P                   8H  4        Rp?EK  T P                  '       Eg   T\        P&                  8X  d   \)        R	4       \)        T	4       T P*                  '       dX   T P,                  P/                  4        \0        P2                  ! ^T P4                  T	4       T P,                  P7                  4        MT P5                  T	4       T P8                  \:        P<                  P>                  8X  d5   \)        R
4       RpT ;P                   ^,          un         RT n          Rp?EK  RT n        h T P                  '       d3   T PB                  '       g!   \        P                  ! ^ \        R4      4      h\)        T: R\E        T	4      : 24       h Rp?i\        PF                   dP   pTP                  w  p
T P                  '       g*   T P%                  T
\        PH                  8H  4        Rp?EKi  h Rp?ii ; i)r    Z	signatureNFTZadminGetServerSettingsrN   ZpkcancelzOperation canceledzGot IPP_SERVICE_UNAVAILABLEzretrying operation...z: )%_passesrs   r`   rl   _perform_authenticationrn   rO   rh   rS   Z__call__IPPErrorZIPP_NOT_AUTHORIZEDru   rj   r   _cancelZIPP_FORBIDDENZIPP_AUTHENTICATION_CANCELED_failedIPP_SERVICE_UNAVAILABLEr^   rY   r[   clearr   timeout_add_ask_retry_server_errorwait_retry_responser   r   r   _has_failed_cannot_authZreprZ	HTTPErrorZHTTP_FORBIDDEN)r#   rq   rr   ru   rv   cZretryZresultZeZmZss   &&&*,      r
   rt   ZConnection._authloop   s   !!##HH[$'9//2a7r o ((( $"2"2E:B((Adnn-t4t444|"mmT-D-DbIIR Q ==  <<<AO--A.B,CDD|||d.E.E)E)*d.@.@)@)*d.N.N)NLL!t'9'9"9::!t/K/K*K =>Nzzz--0((!T-I-I1M,,/44a8++s/?/?/B/BB"$;< $)+/(('+|||D,=,=,="mmQ2F0GHHAtQx 89>> vv|||LL!t':':":;;s_    C2 BC2 2N-AM!A!M	MC;MM8M
<MN-N-AN('N((N-c           	     s   V P                   '       d   \        P                  ! 4         \        R 4      V P                  ^ ,          ,          p\        P                  ! V P                  RR\        P                  P                  \        P                  P                  VR7      pVP                  \        R4      V,          4       VP                  \        P                  \        P                   P"                  \        R4      \        P                   P$                  4       VP'                  \        P                   P$                  4       V P                   '       d4   VP)                  RV P*                  4       \        P,                  ! 4        R# VP/                  4       V n        VP3                  4        R#   \
         d    \        R4      p ELi ; i)zCUPS server error (%s)zCUPS server errorT)transient_formodaldestroy_with_parentmessage_typer&   Ztextz3There was an error during the CUPS operation: '%s'.ZRetryresponseN)rY   r   threads_enterr   rX   
IndexErrorr   MessageDialogrQ   MessageTypeERRORButtonsTypeZNONEZformat_secondary_textZadd_buttonsr;   r   r<   r   r   connect_on_retry_server_error_responsethreads_leaverunr   destroy)r#   ZmessageZmsgds   &&  r
   r   Z"Connection._ask_retry_server_error0  sD   ::: 	)-.1F1Fq1IIC T\\%)t,/OO,A,A'*';';$'	) 	
 $; "<>E"F 	G	s'')9)9)@)@z3#3#3#6#6	8	 0 0 3 34:::IIz4#G#GH #$558D IIL'  	)'(C	)s   #F3 3GGc                sf    W n         VP                  4        V P                  P                  4        R # r   )r   r   r[   setr#   dialogr   rJ   r
   r   Z*Connection._on_retry_server_error_responseK  s"    'r   c                s     R V n         Wn        R# )TN)r   
_forbidden)r#   Z	forbiddenr,   r
   r{   ZConnection._failedP  s    #r   c                s    \        R 4       V P                  '       g   V P                  '       d   R# RV n        Wn        V P                  # )zGot password callbackrN   T)r^   rz   _auth_called_promptrP   r+   r,   r
   _password_callbackZConnection._password_callbackT  s;    +,<<<4,,, !!!r   c                s   V ;P                   ^,          un         \        P                  V P                  V P                  R7      pVe1   V^ ,          R8w  g   V P
                  '       d   Vw  V n        V n        ?\        RV P                   ,          4       V P                   ^8X  dX   RV n	        RV n
        RV n        RV n        RV n        RV n        \        P                   ! V P"                  4       \        R4       ^# \        RV P                  ,          4       V P                  '       g   \        R4       ^ # RV n	        V P                   ^8  d|   V P
                  '       dj   V P$                  R8w  dY   V P                  ^ ,          R8X  g   V P                  '       d/   \        R	4       RV n        RV n         V P'                  RR
7       ^# V P.                  '       g   \        R4       RV n        ^# V P                  '       g   \        R4       RV n        RV n        ^# RV n        V P                  '       dy   V P0                  '       dW   V P2                  P5                  4        \6        P8                  ! ^V P:                  4       V P2                  P=                  4        MV P;                  4        V P0                  '       dW   V P2                  P5                  4        \6        P8                  ! ^V P>                  4       V P2                  P=                  4        MV P?                  4        V P                  '       d   \        R4       R# \        P@                  ! V P                  4       \        R4        V P'                  RR
7       ^#   \(         d'    \        P*                  ! \        P,                  R4      hi ; i  \(         d'    \        P*                  ! \        P,                  R4      hi ; i)i   rE   rF   ZrootzAuthentication pass: %dFz%Authentication: password callback setzForbidden: %sz$Authentication: Operation successfulrg   zAuthentication: Try as root)rp   z server-error-service-unavailablez%Authentication: prompting not allowedTzAuthentication: giving upZ	cancelledzAuthentication: Reconnecti)!rw   global_authinfocacherK   rT   rU   rR   rS   rP   r^   r   r   r   rz   r   _dialog_shownrO   ZsetPasswordCBr   rm   r\   ZRuntimeErrorry   r|   rW   rY   r[   r}   r   r~   _show_not_authorized_dialogr   #_perform_authentication_with_dialogrh   )r#   rB   r0   r
   rx   Z"Connection._perform_authentication]  s   $55DLLtzz5ZaF"d&7&7&77<4!3-<=<<1  %D#DO %D DL %D!&D 7 78?@Odoo56 >? !<<1!!!

f$aC'4??? 9:!'$)!MMMEM2
 ###?@DL   34DL $D " zzz%%(  !T%E%EF$$'003:::OO!!$a!I!IJOO  #447<<<$Idnn%/0	EMMEM*
 c $ M--)E)E)KM MMZ  	E--!=!=!CE E	Es   7N 2N: 1N7:1O+c                s   V P                   '       d   \        P                  ! 4        \        P                  ! V P
                  R R \        P                  P                  \        P                  P                  R7      pVP                  \        R4      4       VP                  R\        R4      ,           R,           \        R4      ,           4       V P                   '       dT   VP                  RV P                  4       VP                  4        VP!                  4        \        P"                  ! 4        R# VP%                  4        VP'                  4        R# )T)r   r   r   r   r&   zNot authorizedr)   z	</span>

zThe password may be incorrect.r   N)rY   r   r   r   r   rQ   r   r   r   ZCLOSEZ	set_titler   r*   r   "_on_not_authorized_dialog_responser"   show_nowr   r   r   )r#   r   r0   r
   r   Z&Connection._show_not_authorized_dialog  s    ::: T\\%)t,/OO,A,A'*'<'<> 	
Q'()	:()*,9:89: 	; :::IIz4#J#JKJJMJJM EEHIILr   c                sZ    V P                   P                  4        VP                  4        R # r   )r[   r   r   r   rJ   r
   r   Z-Connection._on_not_authorized_dialog_response  s    r   c                s   V P                   '       d   \        P                  ! 4        \        V P                  4      ^ 8  d=    \        R4      V P                  ^ ,          ,          p\        VV P                  R7      pM\        V P                  R7      pVP                  R4       VP                  RR.4       VP                  R4       VP                  R4       VP                  4        VP                  4        RV n        V P                   '       d4   VP!                  RV P"                  4       \        P$                  ! 4        R	# VP'                  4       pV P#                  W#4       R	#   \         d    \        R4      p ELi ; i)
r    zAuthentication (%s)r   )r$   r%   )r%   rN   r   Tr   N)rY   r   r   r   rX   r   r   r   rQ   r-   r/   r5   Zset_keep_abover"   r   r   r   _on_authentication_responser   r   )r#   r$   r   r   s   &   r
   r   Z.Connection._perform_authentication_with_dialog  s!   :::  %%&*,01D4I4I!4LL %#'<<1A 4<<0A	b	"b"	J'	$	

	

!:::IIz4#C#CD uuxH,,a:)  ,*+,s   #E) )FFc                s   VP                  4       w  q0n        VR 8w  d   W0n        \        P	                  V P                  V P                  3V P
                  V P                  R7       VP                  4        V\        P                  P                  8X  g    V\        P                  P                  8X  d   RV n        V P                  '       d   V P                  P                  4        R# R# )rN   r   TN)r1   rP   rS   r   rG   rT   rU   r   r   r   r<   ZDELETE_EVENTrz   rY   r[   r   )r#   r   r   Zusers   &&& r
   r   Z&Connection._on_authentication_response  s    %+%9%9%<"!2:!N,,t~~/3/A/A/C37<<37:: 	- 	? 	((///((555DL:::OO" r   )r   rz   r   rl   r   rV   r   r[   r   rY   rX   rQ   rw   rU   r   rW   r   rT   rR   rP   rj   rS   rm   )NTFNNN)Tr2   )r6   r7   r8   r9   r   r_   ra   rc   re   rf   r\   rs   ro   rt   r   r   r{   r   rx   r   r   r   r   r=   r>   r?   r@   r
   rM   rM      sp     .1%$'B<@ODL6
$"dL(;<# #r   rM   Z__main__)TimedOperationT)ru   Z	Connectedr   )z/admin/conf/cupsd.confz/dev/stdout)#rZ   ZconfigrO   rk   ZgiZgi.repositoryr   Zrequire_versionr   r   ri   ZerrordialogsZdebugZgettextZinstallZPACKAGEr   r:   Zrequirer   r   rA   r   rM   r6   Zthreads_initZtimedopsr   Zset_debuggingr   r   r^   rf   ZprintZgetFiler   r   r
   <module>r      s  (     	    5%      5%    	    v~~1A1A B X T* T*r 8 &( k# k#Z z'4
1558AKK	.!)) /0038 r   