3
NZw6              =   @   sT  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T ddlT ddlmZmZmZmZmZ ddlmZ dd	lmZ ydd
lmZ W n8 ek
r Z zeje ddlmZ W Y ddZ[X nX dZdd Z dd Z!dddZ"edddfde dddfej#ej$ej%ddej&ej'dej(ej)ej*ej+ej,ej-ddgZ.ej/eee ee.e0e1fe2e3e4fdZ5e5j6d"d#d$d%d&d'd(d)gdd*\Z7Z8Z9Z:Z;Z<dZ=e>Z?e@ZAdZBxe7D ]\ZCZDeCdkrejEjFejEjGejEjHeDZ=njeCd/kreIZ?e;d0krBejJd1 nFeCd2kr eKZ?e;d0krBejJd3 n"eCd4kr4eLeDZAneCd5krdZBqW ejM r`ejJd6 e0Z:eBstde5_Ne5jO  ePjQZRd7eR ZSe5jT ZUeUdkrejVd8 ejWd9 e=dk	rvejEjXe=sejVd:e=  e"d9 ejEjYe=rejEjZe=d7eR Z=ejEjXe=sejVd:e=  e"d9 ejEj[e=eSkrBejVd;eS  e"d9 ej\e=d< dd=  Z]Z^Z_d>e= Z=ejd?e=e]f  e:e1kre;d0krej` sejVd@e  e"d9 n eja sejVdAe  e"d9 ejbecjddBdCZeeerRyPddlfT yeg ZhdZiW n4 ejjkk
r0 Zl zejVdD dZiW Y ddZl[lX nX W n   ejVdE dZiY nX ndZiddFlmmnZn enjo ZpdZqepjr enjskre=dkrdZqe:e1kr\e;d0kr~yddltT ddGlumvZv W n( ek
r   ejVdH e"d9 Y nX ewejxZyezj{eye|dIeye}dJ e<dkrDe~jddKdLdMZ<e<j dMkrDeej Z<ejdNe<  e<j dOkrdPZy e<jdQ\ZZdQjZeegZ<W n( ek
r   e<ZdQjZe<egZ<Y nX ejdRe<  edZdSe ZejdTe  ejeePjZereyje ndOZ<e<dOkrejdU nTejdVe<  ejee< e<eP_yejejeje< W n ejk
rX   Y nX evj Zeyje ej  eyj  neje;\ZwZeedW Zue;dXkrddYlmZ ne;dZkrddYlmZ ewejxZyeqrejdd[d\eR ejejB ejkre"d9 eujde?eAZej  yejd] eyj  W n( ek
rV   ejVd^ e"d Y nX nؐyejd_ ejd ejd`eR  eqrejdaeR  ejdb\ZZe se re"d e=dk	rXejdddgZejd ejd ejd ej  ejdndhdjdlgdh\ZZe s$edlkr,e"d edhkr>dZ=nxeejdoeR j Z=e=j j dlkrre"d9 e=jdprejVdqe=  qBnejEjFejEjGejEjHe=Z=ejEjXe=sejVd:e=  qBejEjYe=	r
ejEjZe=eSZ=ejEjXe=	s
ejVd:e=  qBejEj[e=eSk	r.ejVd;eS  qBej\e=d< dd=  Z]Z^Z_d>e= Z=P qBW e=jd>	rpejdr n4ejds ejdt ej ZUeU	sejVdu e"d9 ejdve=  ejdwZepje=e \ZZ=Ze  eek
r<ejVe eeefk
r*ejdxdy\ZZe 
se 
r<epje= e"d nepje= e"d9 ejdz epje=e: epje= ejd{gZdZxeD ]ZejeZejdd|d
rre
sejd} dZejejd~e  yejeZW n( ek

r   ejVd e"d9 Y nX ejŃ rejd ejƃ  
qrW W n  ek
r2   ejVd^ Y nX ejd ejd e"d dS )z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             C   s*   t jtd|  | | tj| |  d S )Nd   )pmupdateintr   Zformat_bytes)cst r   /usr/share/hplip/plugin.pyplugin_download_callback6   s    r   c             C   s   t |  d S )N)print)r   r   r   r   plugin_install_callback;   s    r   c             C   s   t j  tj|  d S )N)modZunlockInstancesysexit)coder   r   r   
clean_exit>   s    r    nameTzUsage: %s [MODE] [OPTIONS]Zsummary'Installation for required printer mode:--required (Qt4 only)optionF'Installation for optional printer mode:--optional (Qt4 only)$Specify the path to the plugin file:--p <path> or --path=<path> or --plugin=<path>hp-setupseealsohp-firmwarezsp:zpath=zplugin=zplug-in=zreason=ZgenericZoptionalZrequired)Zhandle_device_printer-p--path--plugin	--plug-inz
--requiredZ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.Z	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.plugindialogZqt5)QMessageBoxZ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   )headerZ
min_widthsd&Download plug-in from HP (recommended)p(Specify a path to the plug-in (advanced)q"Quit hp-plugin (skip installation)z6
Enter option (d=download*, p=specify path, q=quit) ? 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-INZhpzfw-downloadzDOWNLOADING FIRMWAREz%
Downloading firmware to device %s...zError opening device. Exiting.zFirmware download successful.
zDone.)r   )r   r    r!   F)r"   r#   r!   F)r$   r%   r!   F)r&   r   r'   F)r(   r   r'   F)r)   r*   r+   r,   )r8   r9   )r:   r;   )r=   r>   )r?   r@   )rA   rB   )__version____mod__Z	__title____doc__r   ZgetoptZtimeos.pathosreZgzipZbase.gZbase.stringsbaser   r   r   r   r   Zbase.sixext.movesr   Zprntr	   	importlibr
   ImportErrorelogdebugZ
base.utilsr   r   r   r   r   Z
USAGE_MODEZUSAGE_GUI_MODEZUSAGE_INTERACTIVE_MODEZUSAGE_LANGUAGEZUSAGE_OPTIONSZUSAGE_LOGGING1ZUSAGE_LOGGING2ZUSAGE_LOGGING3Z
USAGE_HELPZUSAGE_SPACEZUSAGE_SEEALSOZUSAGEZModuleZINTERACTIVE_MODEZGUI_MODEZUI_TOOLKIT_QT3ZUI_TOOLKIT_QT4ZUI_TOOLKIT_QT5r   ZparseStdOptsZoptsZ
device_uriZprinter_namemodeZ
ui_toolkitr2   Zplugin_pathZPLUGIN_NONEZinstall_modeZPLUGIN_REASON_NONEZplugin_reasonZIs_quiet_modeoapathnormpathabspath
expanduserZPLUGIN_REQUIREDwarnZPLUGIN_OPTIONALr   Zrunning_as_rootquietZ	showTitleZpropZinstalled_versionversionZplugin_filenameZlockInstanceokerrorr   existsisdirjoinbasenamestatsizeZchecksumZ	timestampZcanEnterGUIModeZcanEnterGUIMode4Zto_boolZsys_confgetZPKITZ	base.pkitZ	PolicyKitZpkitZpkit_installedZdbusZDBusExceptionexZ	installerr/   ZPluginHandleZ	pluginObjZplugin_installedZ	getStatusZPLUGIN_INSTALLEDZqtr1   r0   ZQApplicationargvZappZQObjectZconnectZSIGNALZSLOTZ	user_conflowerstrZ
QTextCodecZlocalesplitlx
ValueErrorZQTranslatorZtransZqm_fileloadZlocalization_dirZloadedZinstallTranslatorZQLocaleZ
setDefault	setlocaleLC_ALLZ	normalizeErrorZPluginForm2wZsetMainWidgetZshowZ	exec_loopZimport_dialogZ
ui_packageZPyQt5.QtWidgetsr6   ZPyQt4.QtGuiZquestionZYesZNoZPluginDialogZdialogZexec_KeyboardInterruptinfor<   Zenter_yes_noZcontZansZ	FormattertableaddoutputZenter_choiceZboldstrip
startswithZcheck_network_connectionZProgressMeterZdownloadZstatusZ	error_strr   ZERROR_SUCCESSZERROR_UNABLE_TO_RECV_KEYSZERROR_DIGITAL_SIGN_NOT_FOUNDZdeleteInstallationFilesZ
run_pluginZgetSupportedCUPSDevicesZcups_devicestitleZdevZqueryModelByURIZmqZDevicer=   ZdownloadFirmwarecloser   r   r   r   <module>   s$  
































































