ó J¡Vc@s™ddlZddlZddlZddlmZddlmZddlZddlZddl Z ddl Z ddl Tddl m Z ddl mZddlmZerÌed ƒZd „Zne jd e jje jjƒZejd ƒd Zd Zd ZdZed„Zdefd„ƒYZeƒZ de!fd„ƒYZ"de"fd„ƒYZ#de"fd„ƒYZ$de"fd„ƒYZ%ej&dƒe#ƒZ'e$ƒZ(e%ƒZ)yej*ƒ\e _e _+Wn#e,k rþde _de _+nXe'j-dddƒe _.e j/d e j0ƒgZ1Z2xRe j.j3d!ƒd D]:Z4e1j5e4ƒZ6e6dk rJe2j8e6j9dƒƒqJqJWd!j:e2ƒe _;y<e<d j:ge2D]Z4d"e<e4ƒ^q­ƒd#ƒe _=Wne,k ròde _=nXe'j-d$d%ej>j?ej>j@ejAƒƒƒƒe _BejCejDƒƒde _EejFe jEƒZGeGd&e _Hd'e _Iej>j:e jBd(ƒe _Jej>j:e jBd(d)ƒe _Kej>j:e jBd(d*ƒe _Lej>j:e jBd(d+ƒe _Mej>j:e jBd(d,ƒe _Nd-e _Od.e _Pd/e _Qd0e _Rd1e _Sd2e _Td3e _Uee'j-d4d5d6ƒƒe _Vee'j-d4d7d6ƒƒe _Wee'j-d4d8d6ƒƒe _XeYe _Zee'j-d4d9d6ƒƒe _[ee'j-d4d:d6ƒƒe _\ee'j-d4d;d6ƒƒe _]ee'j-d4d<d6ƒƒe _^ee'j-d4d=d6ƒƒe __ee'j-d4d>d6ƒƒe _`ee'j-d4d?d6ƒƒe _ad@abdaceYadeYdA„ZedB„ZfdC„ZgdD„ZhdE„ZiidFej6dGek6dHel6dIem6dJen6dKeo6dLep6dMeq6dNer6dOes6dPet6dQeu6dRev6dSew6dTex6dUey6dVez6dWe{6dXe|6dYe}6dZe~6d[e6d\e€6d]e6d^e‚6d_eƒ6Z„d`e…fda„ƒYZ†idid6Z‡dS(jiÿÿÿÿNi(tPY3(t configparser(t*(tlogger(tos_utils(t to_unicodetcCs||k||kS(N((tatb((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytcmp,stinfoiiicCsct|tƒrL|rL|djƒdkr/tS|djƒd kr_tSnt|tƒr_|S|S( Nit1tttyt0tftn(R R R (RRR(t isinstancetstrtlowertTruetFalsetbool(tstdefault((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytto_bool:st PropertiescBseZd„Zd„ZRS(cCs-|t|jƒƒkr%|j|ƒSdSdS(NR(tlisttkeyst __getitem__(tselftattr((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyt __getattr__Is cCs|j||ƒdS(N(t __setitem__(RRtval((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyt __setattr__Os(t__name__t __module__R R#(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyRGs t ConfigBasecBsheZd„Zedƒd„Zd„Zd„Zd„Zd„ZeZ d„Z d„Z d „Z RS( cCs&||_tjƒ|_|jƒdS(N(tfilenameRt ConfigParsertconftread(RR'((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyt__init__Ws RcCs<y|jj||ƒSWntjtjfk r7|SXdS(N(R)tgetRt NoOptionErrortNoSectionError(RtsectiontkeyR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR,]scCsI|jj|ƒs%|jj|ƒn|jj|||ƒ|jƒdS(N(R)t has_sectiont add_sectiontsettwrite(RR/R0tvalue((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR3dscCs |jjƒS(N(R)tsections(R((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR6lscCs|jj|ƒS(N(R)R1(RR/((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR1pscCs|jj|ƒS(N(R)toptions(RR/((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR7tscCsã|jdk rß|j}|jdƒr?tjd|jƒdSyit|jdƒ}y|jj|ƒWn2tj k rœtj d|jƒ|j ƒnX|j ƒWqßt ttjfk rÛtjd|jƒqßXndS(Ns/root/sattempted to read from '%s'trsFound Duplicate Entery in %ss#Unable to open file %s for reading.(R'tNonet startswithtlogterrortopenR)treadfpRtDuplicateOptionErrortwarntCheckDuplicateEntriestclosetOSErrortIOErrortMissingSectionHeaderErrortdebug(RR'tfp((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR*ys cCs³|jdk r¯|j}|jdƒs6|jdƒrNtjd|jƒdSy0t|jdƒ}|jj|ƒ|jƒWq¯t t fk r«tj d|jƒq¯XndS(Ns/root/s/etc/sattempted to write to '%s'tws#Unable to open file %s for writing.( R'R9R:R;R<R=R)R4RBRCRDRF(RR'RG((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR4‹s cCsïy,t|jdƒ}|jƒ}|jƒWntk rEd}nXd}x8|jƒD]*}| sr||krY|d|}qYqYWddl}|jƒ\}|_t|jdƒ}|j|ƒ|jƒ|jƒt j |jƒdS(NR8Rs iÿÿÿÿRH( R=R'R*RBRDt splitlinesttempfiletmkstempR4tostunlink(RRtdatat final_dataRRJtfd((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyRAœs"       ( R$R%R+RR,R3R6R1R7RR*R4RA(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR&Vs       t SysConfigcBseZd„ZRS(cCstj|dƒdS(Ns/etc/hp/hplip.conf(R&R+(R((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR+´s(R$R%R+(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyRQ³stStatecBseZd„ZRS(cCs\tjjdƒ rHtjƒdkrHtjdƒd}tj|ƒntj|dƒdS(Ns /var/lib/hp/ischmod 755 /var/lib/hp/s/var/lib/hp/hplip.state( RLtpathtexiststgeteuidtmakedirsRtexecuteR&R+(Rtcmd((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR+¹s % (R$R%R+(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyRR¸st UserConfigcBs#eZd„Zd„Zd„ZRS(cCsýtjƒ\}t_tjƒdksàtjjtjdƒt_tjj tjƒsÊy\t tjdƒj ƒtj tjj tjƒƒ}tjtj|t j|t jƒWqÊtk rÆqÊXntj|tjƒndt_tj|dƒdS(Nis hplip.confRH(Rt getHPLIPDirtproptuser_dirRLRURStjointuser_config_fileRTR=RBtstattdirnametchowntST_UIDtST_GIDRDR&R+R9(RtstsR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR+Âs(  cCsn|jddtjjdƒƒ}y|jdƒ}Wn"tk rXtjd|ƒnXtjd|ƒ|S(Nt last_usedt working_dirt~sutf-8sInvalid unicode: %ssworking directory: %s( R,RLRSt expandusertdecodet UnicodeErrorR;R<RF(RR ((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytworkingDirectoryÙs! cCs:|jdd|jdƒƒtjd|jdƒƒdS(NReRfsutf-8sworking directory: %s(R3tencodeR;RF(RR ((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytsetWorkingDirectoryãs(R$R%R+RkRm(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyRYÁs  iten_UStUTF8thpliptversions0.0.0s(\d\w*)t.s%02xitdirsthomeii2RNtimagestxmltmodelst localizationi iiZsP/usr/share;/usr/local/share;/usr/lib;/usr/local/lib;/usr/libexec;/opt;/usr/lib64s HP-*.ppd.*s,http://www.linuxprinting.org/ppd-o-matic.cgis -hpijs.ppdt configures gui-buildRs network-buildspp-builds scanner-builds fax-builds doc-buildsfoomatic-xml-installsfoomatic-ppd-installshpcups-installs hpijs-installs\|/-\|/-cCs |adS(N(tenable_spinner(tenable((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytchange_spinner_state1scCs\trXtjƒ rXtjjƒrXtjjdttƒtddatjj ƒndS(Nsii( RzR;tis_debugtsyststdouttisattyR4tspinnertspinpostflush(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytupdate_spinner5s"cCsFtrBtjƒ rBtjjƒrBtjjdƒtjjƒndS(Ns (RzR;R}R~RR€R4Rƒ(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytcleanup_spinner<s"cCs:y,g|jdƒD]}t|ƒ^q}WnnX|S(NRr(tsplittint(tvertxtl((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytxintCs ,c Cs:d}|d}ttjjdƒdƒ}|ddkrEd}nd}x;tjdƒD]*\}}}||kr[|}d}q[q[W|dkr¶tjd|ƒtjdƒnt j d |ƒ}t|j dƒƒ} | ddkröd} nd} || kr6tjd |ƒtj d ƒtjdƒndS( Nis.sot iis /usr/lib/is6%s not present in the system. Please re-install HPLIP.spython(\d(\.\d){0,2})s2%s Extension module is missing from Python's path.sMTo fix this issue, please refer to this 'http://hplipopensource.com/node/372'( R‹R~RqR†RLtwalkR;R<texittretsearchtgroupR ( text_modtflagt ext_mod_sot python_vertdirpathR`t filenamestext_pathtmtext_verRˆ((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytcheck_extension_module_envKs,        sNo errors Unknown errorsDevice not foundsUnknown/invalid device-id fields Unknown/invalid device-uri fieldsData length exceeds maximumsDevice I/O errorsNo probed devices founds Device busysDeviceStatus not availablesInvalid service names!Invalid channel-id (service name)s Channel busys!Device does not support operationsDevice open failedsInvalid device nodesInvalid hostname ip addresssInvalid JetDirect port numbersNo CUPS queue found for device.sDAT file errorsInvalid timeouts I/O timeoutsIncompatible fax optionssInvalid fax filesFax file not foundsUnknown internal errortErrorcBseZed„ZRS(cCsV||_tj|ttƒ|_tjd||jfƒtj||j|ƒdS(NsException: %d (%s)( toptt ERROR_STRINGSR,tERROR_INTERNALtmsgR;RFt ExceptionR+(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyR+s (R$R%RŸR+(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pyRœŒstustenten_ustamericantamericatusatenglish(susR£R¤R¥R¦R§R¨(ˆR~RLtos.pathtsixextRt sixext.movesRtlocaletpwdR_RtcodesRRRRttypetQStringR tLoggertLOG_LEVEL_INFOtLOG_TO_CONSOLER;t set_leveltMINIMUM_PYQT_MAJOR_VERtMINIMUM_PYQT_MINOR_VERtMINIMUM_QT_MAJOR_VERtMINIMUM_QT_MINOR_VERRRtdictRR[tobjectR&RQRRRYtumasktsys_conft sys_statet user_conftgetdefaultlocaletencodingt ValueErrorR,RqtcompiletIt_pt_xR†t_ytmatcht_zR9tappendR‘R]tinstalled_versionR‡tinstalled_version_intRStrealpathtnormpathtgetcwdthome_dirtgetpwuidtgetuidtusernametgetpwnamtpdbtuserhomet history_sizetdata_dirt image_dirtxml_dirt models_dirtlocalization_dirtmax_message_lentmax_message_readt read_timeouttppd_search_pathtppd_search_patterntppd_download_urltppd_file_suffixt gui_buildt net_buildt par_buildRt usb_buildt scan_buildt fax_buildt doc_buildtfoomatic_xml_installtfoomatic_ppd_installt hpcups_buildt hpijs_buildRR‚RzR|R„R…R‹R›t ERROR_SUCCESStERROR_UNKNOWN_ERRORtERROR_DEVICE_NOT_FOUNDtERROR_INVALID_DEVICE_IDtERROR_INVALID_DEVICE_URItERROR_DATA_LENGTH_EXCEEDS_MAXtERROR_DEVICE_IO_ERRORtERROR_NO_PROBED_DEVICES_FOUNDtERROR_DEVICE_BUSYt!ERROR_DEVICE_STATUS_NOT_AVAILABLEtERROR_INVALID_SERVICE_NAMEtERROR_ERROR_INVALID_CHANNEL_IDtERROR_CHANNEL_BUSYt'ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATIONtERROR_DEVICEOPEN_FAILEDtERROR_INVALID_DEVNODEtERROR_INVALID_HOSTNAMEtERROR_INVALID_PORT_NUMBERt$ERROR_NO_CUPS_QUEUE_FOUND_FOR_DEVICEtERROR_DATFILE_ERRORtERROR_INVALID_TIMEOUTtERROR_IO_TIMEOUTtERROR_FAX_INCOMPATIBLE_OPTIONStERROR_FAX_INVALID_FAX_FILEtERROR_FAX_FILE_NOT_FOUNDRŸRžR¡Rœtsupported_locales(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/base/g.pytsâ          !   ] (        <  6               #