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biÿÿÿÿ(tprint_functions1.1s+AutoConfig Utility for Plug-in Installationshp-check-pluginsbAuto config utility for HPLIP supported multifunction Devices for installing proprietary plug-ins.N(t*(tutilstdevicettuitmoduletpkittservices(t pluginhandlerts%s/hplip_ac.logscom.hplip.StatusServicec Csqtjdƒ|||||||g}tjdtdƒ}|jdd|Œtƒj|ƒtjdƒdS(Nssend_message() enteredt/tEventt signaturetssisissssend_message() returning(tlogtdebugtlowlevelt SignalMessaget DBUS_SERVICEtappendt SystemBust send_message( t device_urit printer_namet event_codetusernametjob_idttitlet pipe_nametargstmsg((s\/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/check-plugin.pyR7s  c Cs5|rõtjƒs3tjdtƒtjdƒny:ddlm}m }ddl m }ddl m }Wn+tk rštjdƒtjdƒnX|tjƒ}t}t}tj|tk|ƒ\} } | sâ| r1tjdƒq1n<|r$ttd ttd d ƒtjd ƒn tjd ƒdS(Ns+%s requires GUI support . Is Qt4 installed?iiÿÿÿÿ(t QApplicationt QMessageBox(tPluginDiagnose(t core_installs,Unable to load Qt4 support. Is it installed?sFailed to install plug-in.R it AutoConfigsAEvent EVENT_AUTO_CONFIGURE sent to hp-systray to invoke hp-plugins-Run hp-systray manually and re-plugin printer(RtcanEnterGUIMode4Rterrort__mod__tsystexitt PyQt4.QtGuiRR tui4.plugindiagnoseR!t installerR"t ImportErrortargvtPLUGIN_REQUIREDtPLUGIN_REASON_NONERtrun_plugin_commandRRtEVENT_AUTO_CONFIGURERR( tsystray_running_statust run_directlyRR R!R"tapptplugint plugin_reasontoktsudo_ok((s\/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/check-plugin.pytinstall_PluginAs*   c Cs:d}x®|tkr¶|dkr¶tjdƒ|d}tjdƒ\}}tjdƒ\}}|tkr |tkr t}|jƒtkr–Pq³tj dƒt j dƒq q Wd }d }|dk rà|d |7}nt d krù|d 7}n||} tjdƒtjd| ƒtj| ƒ\} } dS(Nipig333333Ó?is hp-pluginshp-diagnose_plugins\Failed to download firmware required files. manually run hp-plugin command in terminal fisrtis hp-firmwareR s -y3 %sRs -gsStarting Firmware installation.sRunning command : %s (tFalsettimetsleepRtIs_Process_RunningtTruet getStatustPLUGIN_INSTALLEDRR%R'R(tNonet log_leveltinfoRtrun( t pluginObjtPlugin_Installation_Completedt USB_paramt sleep_timeoutt ps_plugintoutputtps_diagnose_plugintexecmdtoptionstcmdtStatustout((s\/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/check-plugin.pytinstall_firmware^s,        tnames$Usage: %s [OPTIONS] [USB bus:device]tsummarys'Install Plug-in through HP System Tray:s -m (Default)toptions"Install Plug-in through hp-plugin:s-ps"Download firmware into the device:s-fsInstall plugin:s $%s 001:002texamplesInstall plugin and firmware:s$%s -f 001:002s*-m and -p options can't be used together. tnotettextcCsI|dkrtjttƒntjt|tttƒtjdƒdS(NRWi( Rt log_titlet __title__t __version__t format_texttUSAGER&R'R((ttyp((s\/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/check-plugin.pytusage“s (RRs2hp-check-plugin Tool requires dBus and python-dbusitrun_as_root_oktquietsl:hHuUmMfFpPgGtguithelps help-restshelp-mans help-descslogging=thandle_device_printert HPLIP_DEBUGRRCs-hs-Hs--helps --help-resttrests --help-mantmans-us-Us--guis --help-desctendt is-ls --loggings-gs-Gs-ms-Ms-Ps-FsSaving output in log file: %ss hp-check-plugin starteds.Both -m and -p options can't be used together.sparam=%ssThis is not a valid devices Setting up device: %s s support-typesUnsupported printer model.R5sThis is not a plugin device.s hp-systrays@ hp-systray must be running. Run 'hp-systray &' in a terminal. sStarting hp-systray serviceshp-systray service is running s"Device Plugin is already installedsHP Device Plug-in is not founds>HP Device Plug-in version mismatch or some files are corruptedsDone.(s-hs-Hs--help(s-us-Us--gui(s-ls --logging(s-gs-G(s-ms-M(s-ps-P(s-Fs-f(st __future__RRZRYR&t__doc__R'tostos.pathtgetopttsignaltoperatorR;tbase.gtbaseRRRRRRR+RRRRtproptuser_dirtLOG_FILERRR:R9RQR>t USAGE_OPTIONSt USAGE_HELPtUSAGE_LOGGING1tUSAGE_LOGGING2tUSAGE_LOGGING3tUSAGE_EXAMPLESt USAGE_NOTESR\R^tdbusRRR,RR%R(tModuletINTERACTIVE_MODEtGUI_MODEtUI_TOOLKIT_QT3tUI_TOOLKIT_QT4tmodt parseStdOptstoptstmodet ui_toolkittloct GetoptErrorteRtgetenvt set_levelRBtSystray_Msg_EnabledtPlugin_option_EnabledtFirmware_Option_EnabledtGUI_ModetIs_Plugin_Already_InstalledtotatprinttlowertstripRtparamt IndexErrortpathtnormpathRCtboldtexiststremovetOSErrort set_logfilet set_wheretLOG_TO_CONSOLE_AND_FILERtlentmakeURItsane_uritfax_uritqueryModelByURItmqtgettSUPPORT_TYPE_NONEt PLUGIN_NONER5tSystray_Is_RunningR=tstatusRJtgetuidt run_systrayt PluginHandleRER?t plugin_stsR@tPLUGIN_NOT_INSTALLEDRF(((s\/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/check-plugin.pyts.        .   %    9@