
    Hfi                     8    d dl Z d dlmZ ddl  G d de      Zy)    N)TimedOperation   )*c                   *    e Zd Zd Zd Zd Zd Zd Zy)CheckLocalServerPublishingc                     t         j                  | |d       | j                  t        d      t        d      dz   t        d      z   dz   t        t              z         }|j                  ||        y )NzIs local server publishing?zServer Not Exporting Printersz|Although one or more printers are marked as being shared, this print server is not exporting shared printers to the network.z

zEnable the 'Publish shared printers connected to this system' option in the server settings using the printing administration tool. )Question__init__initial_vbox_TEXT_start_print_admin_toolnew_page)selftroubleshootervboxs      K/usr/share/system-config-printer/troubleshoot/CheckLocalServerPublishing.pyr   z#CheckLocalServerPublishing.__init__   s    41NO  !$C"D"# %/ #0 39#9 #$ %; #<	#< ?B#B #$$?"@#A	B 	t,    c                    i | _         t        j                  d       | j                  j	                         }	 | j                  t        j                  |      j                         }| j                  |j                  |      j                         }t        |      dk(  ry|j                         D ]  \  }}|j                  dd      s n | j                  |j                  f|      j                         }j                  dd      sy|j                  dd      ryy# t        $ r Y yt        j                  $ r Y yw xY w)	N )parentr   Fzprinter-is-shared)argsr   zserver-is-sharing-printersT)answerscups	setServerr   
get_windowtimedop
ConnectionrungetPrinterslenitemsgetgetPrinterAttributesRuntimeErrorIPPError)r   r   cprintersnameprinterattrs          r   displayz"CheckLocalServerPublishing.display(   s"   $$//2	doof=AADA||Q]]6|BFFIHH~"!)!2 g;; 3U; <<!7!7'+g(.   003  {{/788148  	}} 		s$   A(D! !(D! 
0D! !	E,E Ec                 &    | j                   rddiS i S )Nlocal_server_exporting_printersF)	displayedr   s    r   collect_answerz)CheckLocalServerPublishing.collect_answerG   s    >>6??	r   c                 8    | j                   j                          y N)opcancelr0   s    r   cancel_operationz+CheckLocalServerPublishing.cancel_operationM   s    r   c                 :    t        |i || _        | j                  S r3   )r   r4   )r   r   kwargss      r   r   z"CheckLocalServerPublishing.timedopP   s     4262wwr   N)__name__
__module____qualname__r   r,   r1   r6   r    r   r   r   r      s    ->r   r   )r   timedopsr   baser
   r   r<   r   r   <module>r?      s   ,  # 9 9r   