
    Kci                     >    d dl Z d dlmZ ddlT  G d de          ZdS )    N)TimedOperation   )*c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )CheckLocalServerPublishingc                     t                               | |d           |                     t          d          t          d          dz   t          d          z   dz   t          t                    z             }|                    ||            d S )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OO  !$C"D"D"# %/ #0 #0 39#9 #$ %; #< #<	#< ?B#B #$$?"@"@#A	B 	B 	t,,,,,    c                    i | _         t          j        d           | j                                        }	 |                     t          j        |                                          }|                     |j        |                                          }t          |          dk    rdS |
                                D ]\  }}|                    dd          r n|                     |j        |f|                                          }n"# t          $ r Y dS t          j        $ r Y dS w xY w|                    dd          sdS |                    dd          rdS dS )	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2	dof==AADDA||Q]6|BBFFIIHH~~""u!)!2!2  g;; 3U;; E <<!7'+g(.   0 003 D  	 	 	55} 	 	 	55	 {{/77 	5881488 	5ts   A4D ,A"D 
D.D.-D.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                                          d S N)opcancelr0   s    r   cancel_operationz+CheckLocalServerPublishing.cancel_operationM   s    r   c                 2    t          |i || _        | j        S r3   )r   r4   )r   r   kwargss      r   r   z"CheckLocalServerPublishing.timedopP   s     42622w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?      sb   ,  # # # # # #    9 9 9 9 9 9 9 9 9 9r   