
    =	fw6                        d Z dZdZdZddlZddlZddlZddlZddl	Z	ddlZddl
Z
ddl ddl ddlmZmZmZmZmZ ddlmZ dd	lmZ 	 dd
lmZ dZd Z d Z!dodZ"edddfdez  dddfejF                  ejH                  ejJ                  ddejL                  ejN                  dejP                  ejR                  ejT                  ejV                  ejX                  ejZ                  ddgZ. ej^                  eee ee.e0e1fe2e3e4fd      Z5e5jm                  dg dd      \  Z7Z8Z9Z:Z;Z<dZ=e>Z?e@ZAdZBe7D ]  \  ZCZDeCdv rNej                  j                  ej                  j                  ej                  j                  eD                  Z=XeCdk(  reIZ?e;dk(  seej                  d        weCd!k(  reKZ?e;dk(  sej                  d"       eCd#k(  r	 eLeD      ZAeCd$k(  sdZB  ej                         rej                  d%       e0Z:eBsde5_N        e5j                          ePj                  ZRd&eRz  ZSe5j                         ZUeUdu r#ej                  d'        ej                  d(       e=ej                  j                  e=      sej                  d)e=z          e"d(       ej                  j                  e=      rVej                  j                  e=d&eRz        Z=ej                  j                  e=      sej                  d)e=z          e"d(       ej                  j                  e=      eSk7  rej                  d*eSz          e"d(        ej                  e=      d+   dd,cZ]Z^Z_d-e=z   Z=ej9                  d.e=e]fz         e:e1k(  r`e;dk(  r. ej                         sJej                  d/ez          e"d(       n- ej                         sej                  d0ez          e"d(        ej                  ecj                  d1d2            Zeeer	 ddlf 	  eg       ZhdZindZidd5lmmnZn  enj                         ZpdZqepj                         enj                  k(  re=dZqe:e1k(  re;dk(  r	 ddlt dd6lumvZv  ewej                        Zyezj                  ey e|d8      ey e}d9             e<Qe~j                  d:d;d<      Z<e<j                         d<k(  r+ eej                               Z<ej9                  d=e<z         e<j                         d>k7  rd?Z	 e<j                  d@      \  ZZd@j                  eeg      Z<ej9                  dAe<z          ed      ZdBez  Zej9                  dCez         ej                  eePj                        Zereyj                  e       nd>Z<e<d>k(  rej9                  dD       nbej9                  dEe<z         ej                   ee<             e<eP_        	 ej!                  ej"                  ej%                  e<              evj(                         Zeyj-                  e       ej/                          eyj1                          n ej2                  e;      \  ZwZ eedFz         Zue;dGk(  rddHlmZ ne;dIk(  rddHlmZ  ewej                        ZyeqrH ej<                  ddJdKeRz  ej>                  ej@                  z        ej>                  k7  r e"d(       eujC                  de?eA      Zej/                          	 ej9                  dL       eyjG                          n	 ejK                  dN       ejK                  d        ejL                  dOeRz         eqr7ejK                  dPeRz          ejN                  dQ      \  ZZeres e"d       e=C ejT                  dRdST      ZejY                  dU       ejY                  dV       ejY                  dW       ej[                           ej\                  dXg dYdZ      \  ZZered[k(  r e"d       edZk(  rdZ=n	  eej_                  d\eRz              ja                         Z=e=ja                         j                         d[k(  r e"d(       e=jc                  d]      rej                  d^e=z         |ej                  j                  ej                  j                  ej                  j                  e=                  Z=ej                  j                  e=      sej                  d)e=z         ej                  j                  e=      rMej                  j                  e=eS      Z=ej                  j                  e=      sej                  d)e=z         aej                  j                  e=      eSk7  rej                  d*eSz          ej                  e=      d+   dd,cZ]Z^Z_d-e=z   Z=	 e=jc                  d-      r ejL                  d_       nR ejL                  d`       ejK                  da        ejd                         ZUeUsej                  db        e"d(       ejK                  dce=z          ejf                  dd      Zepji                  e=e       \  ZZ=Z e        eek7  rgej                  e       eeefv r6 ejN                  dedf      \  ZZeres5epjw                  e=        e"d       nepjw                  e=        e"d(        ejL                  dg       epjy                  e=e:       epjw                  e=        ejz                  dhg      ZdZeD ]  Z ej                  e      Zej                  did      s)es ejL                  dj       dZejK                  ej_                  dkez               	  ej                  e      ZeĐj                         rejK                  dm       eĐj                           	 ejK                  d       ejK                  dn        e"d       y# e$ r"Zej9                  e       ddlmZ Y dZ[dZ[ww xY w# ejj                  $ rZlej                  d3       dZiY dZl[ldZl[lww xY w#  ej                  d4       dZiY xY w# e$ r ej                  d7        e"d(       Y sw xY w# e$ r e<Zd@j                  e<eg      Z<Y w xY w# ej&                  $ r Y w xY w# e$ r ej                  dM        e"d       Y  w xY w# e$ r ej                  dl        e"d(       Y |w xY w# e$ r ej                  dM       Y bw xY w)pz2.1z	hp-pluginz#Plugin Download and Install Utilityz2HP Proprietary Plugin Download and Install Utility    N)*)deviceutilstuimoduleservices)input)cups)import_module)dyn_import_modc                     t         j                  t        d| z  |z  |z        t        j                  | |z               y )Nd   )pmupdateintr   format_bytes)csts      /usr/share/hplip/plugin.pyplugin_download_callbackr   6   s2    IIc#a%'!)n!$&    c                     t        |        y N)print)r   s    r   plugin_install_callbackr   ;   s	    	!Hr   c                 V    t         j                          t        j                  |        y r   )modunlockInstancesysexit)codes    r   
clean_exitr#   >   s    HHTNr    nameTzUsage: %s [MODE] [OPTIONS]summary)z'Installation for required printer mode:z--required (Qt4 only)optionF)z'Installation for optional printer mode:z--optional (Qt4 only)r'   F)z$Specify the path to the plugin file:z--p <path> or --path=<path> or --plugin=<path>r'   F)zhp-setupr$   seealsoF)zhp-firmwarer$   r(   Fzsp:)zpath=zplugin=zplug-in=zreason=genericoptionalrequiredF)handle_device_printer)z-pz--pathz--pluginz	--plug-inz
--requiredqt3z--required switch ignored.z
--optionalz--optional switch ignored.z--reasonz-sz8It is not recommended to run 'hp-plugin' in a root mode.zhplip-%s-plugin.runzBPlug-in lock acquire failed. check if hp-plugin is already running   zPlug-in path '%s' not found.zPlug-in filename must be '%s'.   g        zfile://zPlugin path=%s (%d)zR%s requires GUI support (try running with --qt4). Try using interactive (-i) mode.zR%s requires GUI support (try running with --qt3). Try using interactive (-i) mode.	configurez
policy-kitzBPolicyKit support requires DBUS or PolicyKit support files missingz)Unable to load pkit...is HPLIP installed?)pluginhandler)pluginform2z,Unable to load Qt3 support. Is it installed?zlastWindowClosed()zquit()uilocsystemzUsing system locale: %sr   utf8.z&Trying to load .qm file for %s locale.zhplip_%s.qmzName of .qm file: %szUsing default 'C' localezUsing locale: %sz.plugindialogqt5)QMessageBoxqt4 zsThe driver plugin for HPLIP %s appears to already be installed. Do you wish to download and re-install the plug-in?zStarting GUI loop...z	User exitz](Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)z!PLUG-IN INSTALLATION FOR HPLIP %sz?The driver plugin for HPLIP %s appears to already be installed.z3Do you wish to download and re-install the plug-in?)OptionDescription)
   2   )header
min_widths)dz&Download plug-in from HP (recommended))pz(Specify a path to the plug-in (advanced))qz"Quit hp-plugin (skip installation)z6
Enter option (d=download*, p=specify path, q=quit) ? )rB   rC   rD   rB   rD   z<Enter the path to the 'hplip-%s-plugin.run' file (q=quit) : zhttp://z(Plug-in filename =%s must be local file.zCOPY PLUGINzDOWNLOAD PLUGINz"Checking for network connection...z Network connection not detected.zDownloading plug-in from: %szDownloading plug-in:z)Do you still want to install the plug-in?nzINSTALLING PLUG-INhpzfw-downloadzDOWNLOADING FIRMWAREz%
Downloading firmware to device %s...zError opening device. Exiting.zFirmware download successful.
zDone.)r   )__version____mod__	__title____doc__r    getopttimeos.pathosregzipbase.gbase.stringsbaser   r   r   r   r   base.sixext.movesr	   prntr
   	importlibr   ImportErrorelogdebug
base.utilsr   r   r   r   r#   
USAGE_MODEUSAGE_GUI_MODEUSAGE_INTERACTIVE_MODEUSAGE_LANGUAGEUSAGE_OPTIONSUSAGE_LOGGING1USAGE_LOGGING2USAGE_LOGGING3
USAGE_HELPUSAGE_SPACEUSAGE_SEEALSOUSAGEModuleINTERACTIVE_MODEGUI_MODEUI_TOOLKIT_QT3UI_TOOLKIT_QT4UI_TOOLKIT_QT5r   parseStdOptsopts
device_uriprinter_namemode
ui_toolkitr4   plugin_pathPLUGIN_NONEinstall_modePLUGIN_REASON_NONEplugin_reasonIs_quiet_modeoapathnormpathabspath
expanduserPLUGIN_REQUIREDwarnPLUGIN_OPTIONALr   running_as_rootquiet	showTitlepropinstalled_versionversionplugin_filenamelockInstanceokerrorr!   existsisdirjoinbasenamestatsizechecksum	timestampcanEnterGUIModecanEnterGUIMode4to_boolsys_confgetPKIT	base.pkit	PolicyKitpkitpkit_installeddbusDBusExceptionex	installerr1   PluginHandle	pluginObjplugin_installed	getStatusPLUGIN_INSTALLEDqtr3   r2   QApplicationargvappQObjectconnectSIGNALSLOT	user_conflowerstr
QTextCodeclocalesplitlx
ValueErrorQTranslatortransqm_fileloadlocalization_dirloadedinstallTranslatorQLocale
setDefault	setlocaleLC_ALL	normalizeErrorPluginForm2wsetMainWidgetshow	exec_loopimport_dialog
ui_packagePyQt5.QtWidgetsr9   PyQt4.QtGuiquestionYesNoPluginDialogdialogexec_KeyboardInterruptinfor@   enter_yes_nocontans	Formattertableaddoutputenter_choiceboldstrip
startswithcheck_network_connectionProgressMeterdownloadstatus	error_strr   ERROR_SUCCESSERROR_UNABLE_TO_RECV_KEYSERROR_DIGITAL_SIGN_NOT_FOUNDdeleteInstallationFiles
run_plugingetSupportedCUPSDevicescups_devicestitledevqueryModelByURImqDevicerB   downloadFirmwareclose r   r   <module>r      s  . 
1	
>     	 	    5 5 # ;' 
&
 B
%''12y$
G







&
&
_
_






t


 4 4e6J6J









,
/!	
( fmmGYWe%x0#^^DdL
 U ?+0  2 6j,j#
 " DAq55gg&&rwwrww7I7I!7L'MN	
l	&HH12	
l	&HH12	
jA	
d%( 8HHGHD CIMMO

 
 ''1;IIRSCHHQK77>>+&		0;>?1	ww}}[!ggll;0E0OPww~~k*II4{BCqM	ww$7		2_DE1 !( 4Q 7SD(Ik)KII#{D&99: 8U$u$$&IIjmttuqM%u%%'IIjmttuqM u}}X\\+|<=
	#;D!N N #&M&&(	 M:::{?R8U	&
 388$V$893XO;--eX6Cyy{h&*++-.		3c9:99;#A)yy~1hh1v&
 II>DE%E#a'GII,w67ZZ)>)>?F%%e,#:II01II(3./ws|,DK  0@0@0EF $K##%!	 $75#6#6z#B j:7835 /388$#{##D!$ "W  X_  "_"-//KNN"BD HSW 1|]C	II,-IIKIpq

6@AHHVY``a((()^_ID#s1 !CMM)BxXEIIEFIIGHIIABLLN((()b%ID# 3#:1 cz  "'1o2  )! #""'%'   #((*002c9"1#..y9		"L{"Z[  ')gg&6&6rwwrwwGYGYZeGf7g&h!ww~~k:II&D{&RS$77==5*,'',,{O*TK#%77>>+#> #		*H;*V W (77++K8OKII&F&XY$4;BGGK4H4KRQT1h	&/+&= !!),CJJ}%CJJ()HH9:///1B		<=1/+=>S56)2););KIa)b&Y ]"IIi 35QRR,C,,-XZ]^	c355kBqM11+>1 	

'([$/))+65v55tf=  	C''',BvvmQ'CJJ56 E "JS"PQR"%c*A
 %%'HH>?	)	4    
1k  ;IIaL::;B !! 	#IIZ["N	#		=>  	IIDEqM	$  )hhQx()0 << H ! 	IIk"qM	H  "II>?qM"  		+s   
q r  	q0 r; (s  !.t "t 6Qu" <u" t="6u" q-q((q-0r?rr  rr   r8;ss s>=s>ttt:9t:=uu" uu" "u<;u<