403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/hplip/base/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/hplip/base/device.pyc
lJc(@sddkZddkZddkZddkZddkZddkZddkZddkZddk	Z	ddk
TddkTddkZddk
Z
ddkZddklZlZlZddkZddkZddkZddklZyddkZWnBej
o6eidoeideidnn+Xy
eiZ Wne!j
o
dZ nXe"a#e"a$y,ddk%Z%dd	k%l&Z&l'Z'e(a#Wn ej
oei)d
nXddk*Z*e*i+de,dd
dgZ-d
dddfZ.d
ddfZ/e0Z1dddddfZ2dfZ3ei4dei5Z6ei4dei5Z7ei4dei5Z8ei4dei5Z9ei:Z;ei4dei5Z<ei4dei5Z=ei4dei5Z>de?fdYZ@de@fd YZAd!e@fd"YZBe0d#ZCdd$ZDd%ZEd&ZFe-d'd(e1d)d*dfd+ZGdge1d,ZHdge1d-ZIdge1d.ZJe"d/ZKd0ZLe(d1ZMd2ZNd3ZOd4ZPd5ZQe(d6ZRd7ZSei4d8ei5ZTeaUe"aVd9ZWd:d;ZXhd<eY6d=eZ6d>e[6d?e\6d@e]6dAe^6dBe_6dCe`6dDea6dEeb6dFec6dGed6dHee6dIef6dJeg6dKeh6dLei6dFej6dMek6dNel6dOem6Znhd<eo6dPep6dQeq6dRer6dSes6dTet6dUeu6dVev6dWew6dXex6dYey6ZzhdZe{6d[e|6d\e}6d]e~6d^e6d_e6d`e6Zhdae6dae6dbe6ZhZdce?fddYZdeeifdfYZdgeifdhYZdS(iiN(t*(tpcltldltcups(tStringTabletHPLIP_BUILDs>HPMUDEXT could not be loaded. Please check HPLIP installation.ii (tlowlevelt
SessionBusspython-dbus not installed.tignoretusbtparRtnettprinttscantfaxtpcardtcopythpsv(.*):/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*)|ip=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^&]*)|zc=(\S+))(?:&port=(\d))?s6/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*))&loc=(\S*)s$direct (.*?) "(.*?)" "(.*?)" "(.*?)"sCTR:\d*\s.*;s]\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\bs/dev/.+s(\d+):(\d+)tEventcBseeZeiddddZdZdZddZddZd	Z	d
Z
dZRS(itcCstti|dd id|_tti|dd id|_t||_tti|dd id|_t||_	tti|dd id|_
|ot||_nt
i
|_d|_d|_dS(Nti@sutf-8i t64s64sI32sI64sftssisisd(tunicodetutilstxrstriptencodet
device_uritprinter_nametintt
event_codetusernametjob_idttitletfloatttimedatettimetpipe_fmttdbus_fmt(tselfRRRRR R!R#((s/usr/share/hplip/base/device.pyt__init__cs((((	cCstid|itid|itid|itid|itid|itid|itid|idS(Ns    device_uri=%ss    printer_name=%ss    event_code=%ds    username=%ss
    job_id=%ds    title=%ss    timedate=%s(	tlogtdebugRRRRR R!R#(R'((s/usr/share/hplip/base/device.pyR*wsc	Cs:ti|i|i|i|i|i|i|i|i	S(N(
tstructtpackR%RRRRR R!R#(R'((s/usr/share/hplip/base/device.pyt
pack_for_pipesthpssdcCst|dj	octid|i||fyti||itSWqptj
otidt	SXndS(Ns'Sending event %d to %s (via pipe %d)...sFailed.(
tNoneR)R*RtostwriteR-tTruetOSErrortFalse(R'tfdt	recipient((s/usr/share/hplip/base/device.pyt
send_via_pipes

scom.hplip.StatusServicecCst|dj	octo\tid|i|ftid|d}|id|i|i	|i
|ndS(Ns$Sending event %d to %s (via dbus)...t/Rt	signature(R/t
dbus_availR)R*RRt
SignalMessagetappendR&tas_tupletsend_message(R'tsession_bust	interfacetmsg((s/usr/share/hplip/base/device.pyt
send_via_dbuss
cCst|iS(N(RR=(R'((s/usr/share/hplip/base/device.pyRscCsd|iS(Ns+<Event('%s', '%s', %d, '%s', %d, '%s', %f)>(R=(R'((s/usr/share/hplip/base/device.pyt__str__scCs.|i|i|i|i|i|i|ifS(N(RRRRR R!R#(R'((s/usr/share/hplip/base/device.pyR=s(t__name__t
__module__tpropRR(R*R-R7RBRRCR=(((s/usr/share/hplip/base/device.pyRbs	
			tFaxEventcBs,eZdZdZdZdZRS(cCs5ti||i||_d|_d|_dS(Nt64s64sI32sI64sfstssisisfs(RR(R=t	temp_fileR%R&(R'RJtevent((s/usr/share/hplip/base/device.pyR(s		cCs2tidti|tid|idS(NsFAX:s    temp_file=%s(R)R*RRJ(R'((s/usr/share/hplip/base/device.pyR*s

cCsd|iS(Ns4<FaxEvent('%s', '%s', %d, '%s', %d, '%s', %f, '%s')>(R=(R'((s/usr/share/hplip/base/device.pyRCscCs4|i|i|i|i|i|i|i|ifS(N(RRRRR R!R#RJ(R'((s/usr/share/hplip/base/device.pyR=s(RDRER(R*RCR=(((s/usr/share/hplip/base/device.pyRGs			t
DeviceIOEventcBs,eZdZdZdZdZRS(cCs5ti||i||_d|_d|_dS(Nt64s64sI32sI64sfItssisisfi(RR(R=t
bytes_writtenR%R&(R'RORK((s/usr/share/hplip/base/device.pyR(s		cCs2tidti|tid|idS(NsDEVIO:s    bytes_written=%d(R)R*RRO(R'((s/usr/share/hplip/base/device.pyR*s

cCsd|iS(Ns9<DeviceIOEvent('%s', '%s', %d, '%s', %d, '%s', %f, '%d')>(R=(R'((s/usr/share/hplip/base/device.pyRCscCs4|i|i|i|i|i|i|i|ifS(N(RRRRR R!R#RO(R'((s/usr/share/hplip/base/device.pyR=s(RDRER(R*RCR=(((s/usr/share/hplip/base/device.pyRLs			cCsd}d}tiptatddfStototidjo!ti	dtatddfSy0|djot
i}nt
i|}Wn\t
ii
j
oJ}tidjotidnti	dtatddfSXy)ti	d|idd}taWqt
ii
j
o}ytidtiWntj
onXtid	}|otii|d	}nGtiitid
}tii|ptidtddfSti	d|titi|d	d
ti	dtidd}xtoy'ti	d||idd}Wngt
ii
j
oU}ti	d|d7}|djotidtddfStidq-Xti	dtaPq-WqXnt||fS(Nis#Not starting dbus: running as root.s&Unable to connect to dbus session bus.s8Unable to connect to dbus session bus (running as root?)s1Connecting to com.hplip.StatusService (try #1)...scom.hplip.StatusServices/com/hplip/StatusServiceis
hp-systrays
systray.pysUnable to start hp-systrays&Running hp-systray: %s --force-startups--force-startups"Waiting for hp-systray to start...iis2Connecting to com.hplip.StatusService (try #%d)...s1Unable to connect to dbus. Is hp-systray running?is
Connected.(R/RFt	gui_buildR4R:t
dbus_disabledR0tgetuidR)R*tdbusRt
exceptionst
DBusExceptionterrort
get_objectR2twaitpidtWNOHANGR3Rtwhichtpathtjointhome_dirtexiststwarntspawnlptP_NOWAITR$tsleep(t	dbus_looptserviceR?teR[tt((s/usr/share/hplip/base/device.pyt	init_dbussr













c
Csd\}}}t}ti|dj	ootid|ti|\}}|tijo(|o!tid|t	}|}qHtidnt
i|dj	ot
i|}|id}	|id}
tid|	|
fti|	|
\}}|t
jo(|o!tid|t	}|}qHtidnti|dj	ortid|ti||\}}|tijo(|o!tid|t	}|}qHtidnotid	|ti||\}}|tijo(|o!tid|t	}|}ntid|pftid
|tddd
g}x=|D]1}ti|y+t|\	}
}}}}}}}}Wntj
o
q|nX|d
jot|}ti||idti\}}|tijo>ti|\}}t|idd}ti|qen|i|ijo"tid|t	}|}Pq|tidq|Wn|oyt|}Wn8tj
o,}tid|id\}}}qX|idttjoV|iddo|idd}n|iddo|idd}qqd\}}}n
d\}}|ot i!dd|n|||fS(NRsTrying parallel with %ss	Found: %ss
Not found.iis Trying USB with bus=%s dev=%s...sTrying IP address %ssTrying ZC hostname %ssTrying serial number %stbusR	R
sio-modetSNs	Error: %sssupport-types	scan-typeishp:shpaio:sfax-typeshpfax:t	last_usedR(RRR(RRR(RRR(RR("R4tdev_pattsearchR/R)R*thpmudexttmake_par_urit
HPMUD_R_OKR2tusb_pattgrouptmake_usb_urit
ERROR_SUCCESStip_pattmake_net_uritmake_zc_uritprobeDevicestparseDeviceURItErrortqueryModelByURItdevice_opentgettHPMUD_UNI_MODEt
get_device_idt
parseDeviceIDtclose_devicetlowerRVRAtSUPPORT_TYPE_NONEtreplacet	user_conftset(tparamtporttcups_uritsane_uritfax_uritfoundtresult_codeturit	match_objt
usb_bus_idt
usb_dev_idtdevicestdtback_endtis_hpRhtmodeltserialtdev_filethosttzctmqt	device_idtdataRetscan_uri((s/usr/share/hplip/base/device.pytmakeURI/s





+
'cCsti|i}t|S(N(tmodelstnormalizeModelNameRt	model_dat(R((s/usr/share/hplip/base/device.pytqueryModelByModelsc
Cs[y+t|\	}}}}}}}}}	Wntj
ottnXt|SdS(N(RxRytERROR_INVALID_DEVICE_URIR(
RRRRhRRRRRR((s/usr/share/hplip/base/device.pyRzs
+i
iRtmdnsc-Csfdh}}|o:yti|ti}	WqNtidd}qNXnxV|D]N}
tid|
|
tjotid|
qUn|
djo|djoHyti||}Wq7t	j
ot
_tidtq7XnEyti||}Wn+t	j
ot
_tidtnXxi|D]}t
||id	d
}
||idd}||idd
}|djoxt|D]}||id|d
d}|dj	o]|djoPt|}ti|idd
}|d
jo5|djod||f}qd||
f}n@|djod|||d
f}nd||
|d
f}t}t|}|ptidt}nWt|idttjotidt}n!|d$jot||}n|o|||
f||<q5qqWq>q>WqU|
d%jo|
djo
ti}n
ti}ti|\}}|tijox|iD]{}t i!|}|i"d
pd}|i"dpd}|i"dpd}|i"dpd}ti|y+t#|\	} }!}"}}#}$}%}&}Wnt	j
o
qnXt}|o|o|!ot|}|ptidt}nWt|idttjotidt}n!|d&jot||}n|o|||f||<q"qqWqqU|
djoht$i%}'t&|'}xM|'D]A}(|(i'}tid ||(i(f|djoy+t#|\	} }!})}}#}$}%}&}Wn't	j
otid!|qZnX|!pqZnt}t|}|pt}tidnWt|idttjotidt}n!|d'jot||}n|o||df||<qqZqZWqUqUWh}*x|D]}|d
7}||\}}}+t}|oZ|	i)d"|||+|f},|,djo*tid#|||+||ft}q>n|o|||*|<qqWt*|*S((Nis{Invalid search pattern. Search uses standard regular expressions. For more info, see: http://www.amk.ca/python/howto/regex/RsProbing bus: %ssInvalid bus: %sRtslps&An error occured during network probe.thns	?UNKNOWN?tnum_devicest	num_portsisdevice%dt0tMDLshp:/net/%s?ip=%sshp:/net/%s?zc=%sshp:/net/%s?ip=%s&port=%dshp:/net/%s?zc=%s&port=%ds
Not found.ssupport-typesNot supported.Rs
print-typeR	R
iiiRs%s: %ssUnrecognized URI: %ss%s %s %s %ss(%s %s %s %s: Does not match search '%s'.(Nsprints
print-type(susbspar(Nsprints
print-type(Nsprints
print-type(+tretcompilet
IGNORECASER)RVR*tVALID_BUSESRtdetectNetworkDevicesRytsockettERROR_INTERNALRtupdate_spinnerR|trangeR/RRRR2RR4RRt
__checkFilterRmtHPMUD_BUS_PARALLELt
HPMUD_BUS_USBt
probe_devicesRot
splitlinest
direct_pattmatchRqRxRtgetPrinterstlenRtnameRltcleanup_spinner(-RhttimeouttttltfilterRlt
net_searchtback_end_filterRtret_devicest
search_pattbtdetected_devicestipRtnum_devices_on_jdtnum_ports_on_jdRtdevRRRtincludeRtbnRRtxtmRtmdltdesctdevidRRtbbRRRRt
cups_printerstptbstprobed_devicestdevid_or_hnR((s/usr/share/hplip/base/device.pyRws
















+


	

+




'
	
+


'

 c
Csh}ti}x|D]}y.t|i\	}}}}}	}
}}}
Wntj
o
qnX|djp'||jpd|jo|djo|o|o
t}t|}|ptidt	}nWt
|idttjotidt	}n!|djot||}n|oyd|jo|iid	d
}n
|i}y||Wn#tj
o|ig||<qX||i|iqqqW|S(NRthpaioRs
Not found.ssupport-typesNot supported.Rs
print-typeshp:shpaio:(Nsprints
print-type(RRRxRRyR2RR)R*R4RR|RR/RRtKeyErrorRR<(RRRtprintersRRRRhRRRRRRRRR((s/usr/share/hplip/base/device.pytgetSupportedCUPSDevicesks>.





	 c
CsMg}ti}x4|D],}y.t|i\	}}}}}	}
}}}
Wntj
o
qnX|djp
||jo|o|ot}t|}|ptidt	}nWt
|idttjotidt	}n!|djot||}n|o&|iid|_|i|qEqqW|S(	NRs
Not found.ssupport-typesNot supported.Rs
print-typesutf-8(Nsprints
print-type(RRRxRRyR2RR)R*R4RR|RR/RRtdecodeR<(RRtprinter_listRRRRRhRRRRRRRR((s/usr/share/hplip/base/device.pytgetSupportedCUPSPrinterss..(




cCs1t||}g}|D]}||iq~S(N(RR(RRRt_[1]R((s/usr/share/hplip/base/device.pytgetSupportedCUPSPrinterNamessc
Cs|djodSd}ti}x|D]}y.t|i\	}}}}}	}
}}}
Wntj
o
q+nX|o>|i|jo.|o|iidd}n
|i}Pq+q+W|S(Nshp:shpaio:(R/RRRxRRyRR(Rt
scan_uri_flagRRRRRRhRRRRRR((s/usr/share/hplip/base/device.pytgetDeviceURIByPrinterNames 
.		c
Csqh}g}|iidD]}|o||iq q ~}xo|D]g}|id}y"|i|di|dWqNtj
o!|i|didqNXqNW|idd|iddd|jo|d|d<|d=nd	|jo|d	|d<|d	=n'd
|jo|d
|d<|d
=n|didod|d<n|S(Nt;t:iiRRRitMODELtSERIALtSERNtX(tstriptsplitt
setdefaultt
IndexErrorR/t
startswith(RRRtyRtz((s/usr/share/hplip/base/device.pyRs.A"#


cCs|id\}}yYttit|dpd}|o)ttit|dpd}nWn6tj
o*|od\}}qd\}}nX||fS(Nt RiR(ii(iR(RRRtxlstriptstrt
ValueError(t	ctr_fieldtconvert_to_inttcountertvalue((s/usr/share/hplip/base/device.pytparseDynamicCounters%-cCsti|}|djo!tid|ttn|idipd}|dj}|idipd}|djo!tid|ttn|id
pd}|idpd}|idpd}|idpd}d}	|p|idpd}	}n|idpd}
|d	joMyt	|
}
Wnt
tfj
o
d}
nX|
djo
d}
qntid|||||||||	|
f
||||||||	|
f	S(Ns Device URI %s is invalid/unknowniRRthpfaxRiR	RtbttfwR
iiiiiiisT%s: back_end:%s is_hp:%s bus:%s model:%s serial:%s dev_file:%s host:%s zc:%s port:%s(shpRshpaio(susbsnetRRspar(t
pat_deviceuriRR/R)R*RyRRqRRRt	TypeError(RRRRRhRRRRRR((s/usr/share/hplip/base/device.pyRxs8



	&cCs
|djS(NR
R	RR(sparsusbsfwsbt((Rh((s/usr/share/hplip/base/device.pytisLocal;scCs
|djS(NR(snet((Rh((s/usr/share/hplip/base/device.pyt	isNetwork?scCsWxP|iD]B\}}|dj	o)|\}}||||ptSq
q
WtS(N(titemsR/R4R2(RRtfRtoptval((s/usr/share/hplip/base/device.pyRGs


cCsOxH|D]@}|o
t}nt}||jotid|tSqWtS(NsInvalid bus name: %s(RtVALID_BUSES_WO_CUPSR)RVR4R2(Rht
allow_cupsRtvb((s/usr/share/hplip/base/device.pytvalidateBusListQs

	cCsJ|djotSx1|D])}|tjotid|tSqWtS(Ns Invalid term '%s' in filter list(R/R2t
VALID_FILTERSR)RVR4(RR((s/usr/share/hplip/base/device.pytvalidateFilterList_s

	s%(.*)%c
Cstad}xtot}xutiD]j}ti|\}}||}}yti|id}Wntt	fj
o
d}nX|dj	oHt}yti|\}}Wqtj
oti
d|qXnyti|id}	Wntt	fj
o
d}	nX|	dj	oHt}yti|	\}}Wqrtj
oti
d|	qrXn|o||fti|<q&q&W|pPq|d7}|djoPqqWdS(NiisString interpolation error: %si(R2tstrings_initR4tsttstring_tablet	inter_patRRqtAttributeErrorRR/RR)RV(
tcyclesRtstshort_stringtlong_stringt
short_replacetlong_replacetshort_matchtdummyt
long_match((s/usr/share/hplip/base/device.pytinitStringstsH





icCsVtptntiit|d|}t|tdjo|S|S(NR(RR(RRRR
R|Rttype(t	string_idttypR((s/usr/share/hplip/base/device.pytqueryStringstinvalidtblacktcmytkcmtcyantmagentatyellowt
photo_cyant
photo_magentatphoto_yellowt
photo_grayt
photo_bluetkcmy_cmtphoto_cyan_and_photo_magentatlight_gray_and_photo_blackt
light_graytmedium_graytcyan_and_magentatblack_and_yellowtunspecifiedtheadtsupplyt	cartridgettonert	maint_kittadf_kittdrum_kitttransfer_kittbatterytunknowntoktmisinstalledt	incorrecttfailedtovertemptchargingtdischargingtlowtouttDevicecBs5eZeeeedZddddZdZdZdZedZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&eed%Z'd&Z(eed'Z)d(Z*d)Z+e,i-d*Z.d+Z/e0d,Z1ee2i3ed-Z4ee2i3ed.Z5ee2i3ed/Z6ee2i3ed0Z7ee2i3e0d1Z8ee2i3e0d2Z9ee2i3e0d3Z:ee2i3ed4Z;d5Z<d6Z=d7Z>d8Z?d9Z@d:ZAd;ZBd<ZCd=e0d>ZDeee0ed?ZEed@ZFeee0edAZGedBZHee0e0dCZIdDZJdEZKdFZLeedGZMRS(Hc	Cstid|tid||a|p?|djot\|_|_}qt|_||_nt|_d|_d|_	t
i}|djoi|dj	o\xY|D]A}|ii
|i
jo|i}tid|PqqWttn||_||_t|_|idjottn|iido
t|_nA|iido
t|_n!|iido
t|_nyIt|i\	|_|_|_|_|_|_|_|_ |_!Wn(tj
ot"|_#tt$nXtid|i|i|i|i|i|i|i|i!ft%i&|i|_'t%i(|i|_tid|i|i'fh|_)h|_*d|_+g|_,h|_-d	|_.d|_/d
|_0t|_1t2|_#t3|i|_4g|_5t|_6|i7|i6p1ti8d|it9|_:|i;|i:n
t|_6|i)i<h|id6|i'd
6t=|_>t?|_@tA|_B|iC|i)iDdtEtEjo6|i*i<h|iiFddiFddd6n|i)iDdtGtGjo6|i*i<h|iiFddiFddd6n|i*i<h|id6|id6|id6|id6|id6|i!d6diH|i,d6|iBd6d
d6d
d6d d!6d
d"6d
d#6|i@d$6|i>d%6|id&6|iiFddiFddd'6h|id(6|id)6|iiFddd*6|iiFddd+6|iiFddd,6|iId-6tJiKd.6|_LdS(/NsDevice URI: %ssPrinter: %sshp:shpaio:shpfax:sPURI: backend=%s, is_hp=%s, bus=%s, model=%s, serial=%s, dev=%s, host=%s, port=%dsModel/UI model: %s/%stdefault_printeriRsUnsupported model: %sRsmodel-uisfax-typeshp:/shpfax:/shpaio:/sfax-uris	scan-typesscan-urisback-endsis-hpRsdev-fileRRt,s
cups-printerssstatus-codesstatus-desctdeviceiditpanelspanel-line1spanel-line2sdevice-stateserror-states
device-uriscups-uritURIt
DEVICE_URItSCAN_URItSANE_URItFAX_URItPRINTERtHOME(MR)R*RQR/RgR:RdR2R4t
last_eventRRRRRRytERROR_DEVICE_NOT_FOUNDtcallbacktDEVICE_TYPE_UNKNOWNtdevice_typeRtDEVICE_TYPE_PRINTERtDEVICE_TYPE_SCANNERtDEVICE_TYPE_FAXRxRRRhRRRRRRtIO_STATE_NON_HPtio_stateRRtnormalizeModelUINametmodel_uiRRtdqticonRtchannelsRtr_valuestdeviceIDtpanel_checktIO_STATE_HP_READYRtis_localthistt	supportedt
queryModelRVtSTATUS_DEVICE_UNSUPPORTEDt
error_codet	sendEventtupdatetERROR_STATE_ERRORterror_statetDEVICE_STATE_NOT_FOUNDtdevice_statetEVENT_ERROR_DEVICE_NOT_FOUNDtstatus_codetupdateCUPSPrintersR|t
FAX_TYPE_NONERtSCAN_TYPE_NONER\tfirst_cups_printerRFR]tdevice_vars(	R'RRRdRStdisable_dbusR?RR((s/usr/share/hplip/base/device.pyR(s
	
								


I		8												

					
66









&


Ric
Cs|ioy|idj	oiy:tid||ii|i||ti||Wqt	i
ij
o}tidqXndS(NsSending event %d to hpssd...s dbus call to SendEvent() failed.(R:RdR/R)R*t	SendEventRRFRRSRTRU(R'RRR R!Re((s/usr/share/hplip/base/device.pyRj}s)cCsdS(N((R'((s/usr/share/hplip/base/device.pytquitscCsx|ipt|i|_nt|i|_|io8x5|iD]&}|i||i|idd<qFWndS(Nt-t_(RRzRtboolRft__dict__R(R'R((s/usr/share/hplip/base/device.pyRgs


cCs
t|S(N(R(R'R((s/usr/share/hplip/base/device.pyRscCse|ioW|ittfjoA|i}t|_t|_t|_t|_	d|_
||_|o3ti
d|i|iidti|_n0ti
d|i|iidti|_ti
d|iti|i|i\}|_
|tijot|_|t|_|i|i|tijotid|intid||ift|id	ttid
d	ti|_t t!qati
d|i
t"|_t#|_ti
d|i$|i|i%|i&|i'|i(|i)|i*|i+f	|tjo
t,|_n
t-|_|i.|i/|i
SndS(
Nis!Opening device: %s (for printing)sio-modes%Opening device: %s (not for printing)sio-mfp-modesI/O mode=%dsDevice busy: %ss/Unable to communicate with device (code=%d): %sRisdevice-id=%ds_Opened device: %s (backend=%s, is_hp=%s, bus=%s, model=%s, dev=%s, serial=%s, host=%s, port=%d)(0RfRZRctIO_STATE_HP_NOT_AVAILRoRnRlRmRpRqRtopen_for_printingR)R*RRR|RmR}tio_modetopen_deviceRotERROR_CODE_BASERiRjtHPMUD_R_DEVICE_BUSYRVRRFRR$RQRyRRtIO_STATE_HP_OPENtERROR_STATE_CLEARRRRhRRRRRtDEVICE_STATE_JUST_FOUNDtDEVICE_STATE_FOUNDtgetDeviceIDtgetSerialNumber(R'Rtprev_device_stateR((s/usr/share/hplip/base/device.pytopensJ 							!	
			 

	

cCs|itjotidt|idjo+x(|iiD]}|i|qCWnti	|i
}tid||iit|_ndS(NsClosing device...isResult-code = %d(
RZRR)R*RR_tkeyst_Device__closeChannelRmRRtclearRc(R'tcR((s/usr/share/hplip/base/device.pytcloses

cCs+y|itjoo|tijo&|io|i|itq|tijo%|io|i|itqn|i|tijWnt	i
ddSX|i}||ijoOt	i
d|ti|i|\}}||i|<t	i
d||S|i|SdS(Nsunable to open channelisOpening %s channel...s
channel-id=%d(RZRRmtHPMUD_S_PRINT_CHANNELRRRR2R4R)RVtupperR_R*topen_channelR(R'tservice_nameRt
channel_id((s/usr/share/hplip/base/device.pyt
__openChannels(



cCs
|i|S(N(t_Device__openChannel(R'R((s/usr/share/hplip/base/device.pytopenChannelscCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pyt	openPrintscCs|itiS(N(RRmtHPMUD_S_FAX_SEND_CHANNEL(R'((s/usr/share/hplip/base/device.pytopenFaxscCs|itiS(N(RRmtHPMUD_S_MEMORY_CARD_CHANNEL(R'((s/usr/share/hplip/base/device.pyt	openPCard	scCs|itiS(N(RRmtHPMUD_S_EWS_CHANNEL(R'((s/usr/share/hplip/base/device.pytopenEWSscCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pyt
closePrintscCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pyt
closePCardscCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytcloseFaxscCs|itiS(N(RRmtHPMUD_S_PML_CHANNEL(R'((s/usr/share/hplip/base/device.pytopenPMLscCs|itiS(N(RRmtHPMUD_S_WIFI_CHANNEL(R'((s/usr/share/hplip/base/device.pytopenWifiConfigscCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytclosePMLscCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytcloseEWS!scCs|itiS(N(RRmtHPMUD_S_CONFIG_UPLOAD_CHANNEL(R'((s/usr/share/hplip/base/device.pyt
openCfgUpload$scCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytcloseCfgUpload'scCs|itiS(N(RRmtHPMUD_S_CONFIG_DOWNLOAD_CHANNEL(R'((s/usr/share/hplip/base/device.pytopenCfgDownload*scCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytcloseCfgDownload-scCs|itiS(N(RRmtHPMUD_S_SOAP_FAX(R'((s/usr/share/hplip/base/device.pytopenSoapFax0scCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytcloseSoapFax3scCs|itiS(N(RRmR(R'((s/usr/share/hplip/base/device.pytcloseWifiConfig6scCso|itjo[|i}||ijo;tid|ti|i|i|}|i|=qkndS(NsClosing %s channel...(	RZRRR_R)R*Rmt
close_channelR(R'RR((s/usr/share/hplip/base/device.pyt__closeChannel9scCs
|i|S(N(R(R'R((s/usr/share/hplip/base/device.pytcloseChannelHscCst}|itjo#y|iWndSXt}nti|i\}}|tijod|_	h|_
n||_	t||_
|o|in|i
S(NiR(
R4RZRRR2RmR~RRotraw_deviceIDRaRR(R'tneeds_closeRR((s/usr/share/hplip/base/device.pyRLs 
	
	cCs|iodSy|id|_Wntj
onX|iodS|iidttjoTzBy|iti\}|_Wnt	j
od|_nXWd|i
Xn|idjo
d|_ndS(NRisstatus-typeR(RRaRRR|tSTATUS_TYPE_NONEtgetPMLtpmltOID_SERIAL_NUMBERRyRR/(R'Ri((s/usr/share/hplip/base/device.pyRds"

cCsdS(N((R'((s/usr/share/hplip/base/device.pytgetThreeBitStatusscCs |itit|iS(N(RtstatustparseStatusRR(R'((s/usr/share/hplip/base/device.pytgetStatusFromDeviceIDs
cCsut|}diddt||g}|d |d}}t|}||||f|_||||fS(NRRi	i(RR\RRR`(R'tr_valuetr_value_strtrgtrr((s/usr/share/hplip/base/device.pyt__parseRValuess#c
Cs=d
\}}}}|djo|tjo|idjo|ioWy"t|ii|id}Wqti	i
j
o}tidd}qXn|djo=tid||i
|\}}}}||||fSn|idjo|tjo|io|tjozy|id	}|dj	otid||i
|\}}}}|ioLy|ii|id|Wqti	i
j
o}tid
qXqntidd}Wn&tj
otidd}nXWd|iXq)|tjo|tjo|ip
|tjoz|iti\}	}|dj	otid||i
|\}}}}|ioLy|ii|id|Wqti	i
j
o}tid
qXqnd}Wd|iXq)q-|i\}}}}n||||fS(Nit	000000000t000t000000Rs(dbus call to GetCachedIntValue() failed.is
r_value=%dis(dbus call to SetCachedIntValue() failed.s%Error attempting to read r-value (2).s%Error attempting to read r-value (1).(iRRR(tSTATUS_DYNAMIC_COUNTERS_NONER`R/R:RRdtGetCachedIntValueRRSRTRUR)R*t_Device__parseRValuest
STATUS_TYPE_SRdt STATUS_DYNAMIC_COUNTERS_PML_SNMPtgetDynamicCountertSetCachedIntValueRVRyRtSTATUS_DYNAMIC_COUNTERS_PCLRRt
OID_R_SETTINGR(
R'tr_typetstatus_typetdynamic_countersRRRRReR((s/usr/share/hplip/base/device.pyt
getRValuessj


"















cCs|iidt}t|_|tjo|itjo
|itt	fjopy|i
Wqtj
oO}ti
dt|idttiddti|_ttqXn|i|i}|iih
|id6di|id6|id6|d	6|id
6dd6dd6dd
6|id6|id6ntidti|\}}|o
t |_n|o
t!|_nt"i|it#|_|i|_$|i%|i$y1|iih|i|id	6|id6Wn7t&tfj
o%|iihdd	6t#d6nX|i'o"t(|iidd|_'n|iidt)}|i'o|t*t+t,fjoy|tjoltidzti-|\|_'}	}
Wd|i.X|iiht/|i'd6|	d6|
d
6n|o|o|i0q,nx1|iD]&}|i||i1|i2dd<q6Wt|id|itiddti|_ti|idS(Nsio-modesError getting device ID.RiRRGs
cups-printerssstatus-codesstatus-descRHRIspanel-line1spanel-line2sdevice-stateserror-statesFax activity check...spanel-check-typesstatus-typesPanel check...RzR{(3RR|tIO_MODE_UNItSTATUS_PRINTER_IDLERqRoRnt	tech_typetTECH_TYPE_MONO_INKtTECH_TYPE_COLOR_INKRRyR)RVRRtERROR_DEVICE_IO_ERRORRFRR$RQRR]RkRR\RRRmR*RtgetFaxStatustSTATUS_FAX_TX_ACTIVEtSTATUS_FAX_RX_ACTIVEtSTATUS_TO_ERROR_STATE_MAPRRiRjRRbR|RtSTATUS_TYPE_LJRtSTATUS_TYPE_VSTATUSt
PanelCheckRRRrR}R(R'tquicktreread_cups_printersRRetstatus_desct	tx_activet	rx_activeRtline1tline2R((s/usr/share/hplip/base/device.pyt
__queryFaxsv	









"



$0cCsg|_tidti}xq|D]i}|i|ijoP|ii|i|i|_|i	t
jo|iidd|_
qq)q)W|iihdi|id6y|id|_Wntj
od|_nXdS(Ns*Re-reading CUPS printer queue information.RGis
cups-printersR(RR)R*RRRR<RtstateRZRYt	makemodelRRR]RkR\RuR(R'RR((s/usr/share/hplip/base/device.pyRr7s	
%#c&CsT
|ip;h|_t|idttiddti|_dS|i	t
jo|i||S|ii
dd}|ii
dt}|ii
dt}|ii
dt}|ii
dt}|ii
dt}|ii
d	t}	t}
g}|itjo	|ittfjopy|iWqtj
oO}tid
t|idttiddti|_ttqXn|i|i}
|ii h
|i!d6di"|i#d
6|id6|
d6|i$d6dd6dd6dd6|id6|i%d6h}|tjoti&dhtd6}n|t't(fjo#ti)dt*i+|i,}n|t-t.fjo&ti)dt*i/||i,}nl|t0jo ti)dt*i1|}n?|t2jo ti)dt*i3|}ntid||o1|tjo$ti)dt*i4|||n|oWti)||ii |y|dWnt5j
oqX|d}|id=n|ii
dt}
t6i
|
t7|_%|
|_8|i9|i8y.|ii h|i|
d6|i%d6Wn7t5tfj
o%|ii hdd6t7d6nXd}|oS|tjoF|i:o"t;|ii
dd|_:n|i:o|t-t(t'fjoy|tjolti)dzt*i<|\|_:}}Wd|i=X|ii ht>|i:d6|d6|d6n|tjo2|tjo%|i?|||\}}}}ndU\}}}}|ii h|d#6|d$6|d%6|d&6n|o|o|i@n|p
|djoV|ii
d'|ddjo6d}|ii h|d#6|d$6|d%6|d&6ndV\}}xtAo|ii
d)||fd*}|d*joPn|ii
d+||fd}|ii
d,||fd}tB}ti)d-||fxG|D]?}|d.}|d/}||jo||jotA}PqqW|oti)d0|||f|i
d1tC}|i
d2d3}|i
d4tD} ti)d5||| |
fd6tEi
|d7tFi
|d7f}!|i|!}"d8}!|
tGjp
|
tHjo|tCjp|tIjo|tJjo| tKjod9tLi
| d7}!|ttfjo|tM}#n|tN}#|#|id<|i|#|id<t6i
|#tO|id<|#|_8|i9|i8| tPtQfjo
d:}!nd;}!|i|!}$|ii h|d<|6|d=|6|i
d>tBd?|6|d@|6|dA|6| dB|6|i
dCtBdD|6|i
dEtBdF|6|dG|6|i
dHddI|6|i
dJtBdK|6|"dL|6|i
dMddN|6|$dO|6ndPtRi
|tC}!|i|!}$|ii h|d<|6|d=|6tBd?|6|d@|6|dA|6| dB|6tBdD|6tBdF|6|dG|6ddI|6tBdK|6|"dL|6ddN|6|$dO|6|d(7}nti)dQ||d(7}qaWqnd}|djo!|iSdj	o|iSd}n|djo&|ii
d'ddjo
d}nd(}xotAog|ii
d)||fd}|djoPn|ii
d+||fd}|ii
d,||fd}d6tEi
|d7tFi
|d7f}!|i|!}"|ii h|d<|6|d=|6tBd?|6|d@|6ddA|6tQdB|6tBdD|6tBdF|6tUdG|6ddI|6tBdK|6|idRdO|6|"dL|6ddN|6|d(7}qpWx1|iD]&}%|i|%|iV|%iWdSdT<qWt|id|
tiddti|_ti)|idS(WNRisr-types	tech-typesstatus-typesstatus-battery-checksstatus-dynamic-counterssio-modesio-mfp-modesError getting device ID.RRGs
cups-printerssstatus-codesstatus-descRHRIspanel-line1spanel-line2sdevice-stateserror-statesNo status available for device.s Type 1/2 (S: or VSTATUS:) statuss"Type 3/9 LaserJet PML(+PJL) statussType 6: LJ XMLsType 8: LJ PJLsUnimplemented status type: %dsBattery check...tagentsspanel-check-typesPanel check...RRRtrtrsRRsr%d-agent1-kindisr%d-agent%d-kindisr%d-agent%d-typesr%d-agent%d-skusLooking for kind=%d, type=%d...tkindRsfound: r%d-kind%d-type%dthealthtlevelids
level-triggers5health=%d, level=%d, level_trigger=%d, status_code=%dsagent_%s_%sR;tagent_health_oksagent_level_%stagent_level_outtagent_level_lowsagent%d-kindsagent%d-typetknowns
agent%d-knownsagent%d-skus
agent%d-levelsagent%d-level-triggertacksagent%d-ackshp-inksagent%d-hp-inksagent%d-healthtdvcsagent%d-dvctvirginsagent%d-virginsagent%d-desctids
agent%d-idsagent%d-health-descsagent_health_%ss
Not found: %dtagent_health_unknownRzR{(is	000000000s000s000000(ii(XRfR]RRRhRFRR$RQRURXt_Device__queryFaxRR|tTECH_TYPE_NONERtSTATUS_BATTERY_CHECK_NONERRtSTATUS_UNKNOWNRoRnRRRRRyR)RVRRRqRkRR\RRRmR_RRR*RRRaRtSTATUS_TYPE_PML_AND_PJLtStatusType3tSTATUS_TYPE_LJ_XMLtStatusType6tSTATUS_TYPE_PJLtStatusType8tBatteryCheckRRRRiRjRbR|RRRRRrR2R4tAGENT_HEALTH_OKt AGENT_LEVEL_TRIGGER_SUFFICIENT_0tAGENT_typestAGENT_kindsRtSTATUS_PRINTER_OUT_OF_INKtAGENT_HEALTH_FAIR_MODERATEtAGENT_KIND_HEADtAGENT_LEVEL_TRIGGER_MAY_BE_LOWtAGENT_levelstSTATUS_PRINTER_LOW_INK_BASEtSTATUS_PRINTER_LOW_TONER_BASEtERROR_STATE_LOW_SUPPLIESt AGENT_LEVEL_TRIGGER_PROBABLY_OUTt)AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUTt
AGENT_healthsR`R/tAGENT_HEALTH_MISINSTALLEDR}R(&R'RRRRRt
battery_checkRRtio_mfp_modeRqRReRtstatus_blockRRRRRRtataat
mq_agent_kindt
mq_agent_typetmq_agent_skuRtagentt
agent_kindt
agent_typetagent_healthtagent_leveltagent_level_triggertqueryt
agent_desctcodetagent_health_descR((s/usr/share/hplip/base/device.pytqueryDeviceMs
	
















	
"




%-




				



	
		)

	
$-cCs>y|idtWntj
otSX|ittfjS(NR(R(R2RyRmRltERROR_STATE_BUSY(R'((s/usr/share/hplip/base/device.pytisBusyOrInErrorStates
cCs>y|idtWntj
otSX|ittfjS(NR(R(R2RyR4RmRlR)(R'((s/usr/share/hplip/base/device.pytisIdleAndNoErrors
c	Cs|i}ti|i|ti|d|d\}}}}|tijo&tid|d|f|dfSti
||d|}tioq|dtiti
fjo,tid|d|fti|qtid|d|t|fn||fS(Niis+PML/SNMP GET %s failed (result code = 0x%x)s.PML/SNMP GET %s (result code = 0x%x) returned:s1PML/SNMP GET %s (result code = 0x%x) returned: %s(RRmtget_pmlRRt	PMLToSNMPtERROR_MAX_OKR)R*R/tConvertFromPMLDataFormattis_debugtTYPE_STRINGtTYPE_BINARYtlog_datatrepr(	R'toidtdesired_int_sizeRRRRtpml_result_codetconverted_data((s/usr/share/hplip/base/device.pyRs8
		cCs|i}ti||d}ti|i|ti|d|d|\}}tioq|dti	ti
fjo,tid|d|fti|qtid|d|t
|fn|S(Niis(PML/SNMP SET %s (result code = 0x%x) to:s+PML/SNMP SET %s (result code = 0x%x) to: %s(RRtConvertToPMLDataFormatRmtset_pmlRR-R)R0R1R2R*R3R4(R'R5RRRR7((s/usr/share/hplip/base/device.pytsetPMLs5
		c
Css|iidt}tid||tjo0|tjo9|itidt	|iti
|dt	n|iti|dt	d
\}}}}}t
idxt	o|io|in|d7}|d7}t
i||id|ijo|ti|idj	oct|id|\}	}||	jo6|itiddt	|pd	|}n|Sn||joa|tjo3|iti|iti
|dt	n|itiddt	dS|tjo3|iti|iti
|dt	q|iti|dt	qWn
ttdS(Nsstatus-dynamic-counterssDynamic counters: %dtdirectig?iitCTRt#(iiig?i(RR|RR)R*t#STATUS_DYNAMIC_COUNTERS_LIDIL_0_5_4t	printDataRtbuildResetPacketR2tbuildDynamicCountersPacketRtbuildDynamicCounterR$RbRSRRatpat_dynamic_ctrRlRR/RRyt'ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION(
R'RRRRttriest
times_seentsleepy_timet	max_triestdev_counter((s/usr/share/hplip/base/device.pyRsH

 






	

 
 %cCs|i|i||||S(N(t_Device__readChannelR(R't
bytes_to_readtstreamRtallow_short_read((s/usr/share/hplip/base/device.pyt	readPrintscCs|i|i||||S(N(RKR(R'RLRMRRN((s/usr/share/hplip/base/device.pyt	readPCardscCs|i|i||||S(N(RKR(R'RLRMRRN((s/usr/share/hplip/base/device.pytreadFax"scCs|i|i||||S(N(RKR(R'RLRMRRN((s/usr/share/hplip/base/device.pyt
readCfgUpload%scCs|i|i||||S(N(RKR(R'RLRMRRN((s/usr/share/hplip/base/device.pytreadEWS(scCs|i|i||||S(N(RKR(R'RLRMRRN((s/usr/share/hplip/base/device.pytreadSoapFax+scCs|i|i||||S(N(RKR(R'RLRMRRN((s/usr/share/hplip/base/device.pytreadWifiConfig.scCs|}tid||i|||fd}|djo
d}nx\toTti|i|||\}	}
tid|	t|
}|	tijotidPn|	ti	joti
dttn|ptidPn|djodi
||
g}n|i|
||7}|idj	o|in||jotidPn|o)||jotid	||fPqLqLW|djotid
||Stid||SdS(NsRReading channel %d (device-id=%d, bytes_to_read=%d, allow_short=%s, timeout=%d)...iRsResult code=%dsI/O timeoutsChannel read errorsEnd of datasFull read complete.s.Allowed short read of %d of %d bytes complete.s"Returned %d total bytes in buffer.sSaved %d total bytes to stream.(R)R*RR/R2Rmtread_channelRtHPMUD_R_IO_TIMEOUTRoRVRyRR\R1RS(R'topenerRLRMRRNRt	num_bytestbufferRRtl((s/usr/share/hplip/base/device.pyt
__readChannel1sJ		

!









cCs|i|i|S(N(t_Device__writeChannelR(R'R((s/usr/share/hplip/base/device.pyt
writePrintlscCs|i|i|S(N(R]R(R'R((s/usr/share/hplip/base/device.pyt
writePCardoscCs|i|i|S(N(R]R(R'R((s/usr/share/hplip/base/device.pytwriteFaxrscCs|i|i|S(N(R]R(R'R((s/usr/share/hplip/base/device.pytwriteEWSuscCs|i|i|S(N(R]R(R'R((s/usr/share/hplip/base/device.pytwriteCfgDownloadxscCs|i|i|S(N(R]R(R'R((s/usr/share/hplip/base/device.pytwriteSoapFax{scCs|i|i|S(N(R]R(R'R((s/usr/share/hplip/base/device.pytwriteWifiConfig~sc	Cs|}|dt|}}}tid|||ifxt|djoti|i||ti \}}tid||tijoti	dt
tn|ti}||7}|idj	o|iqCqCW||jot
tn|S(Nis0Writing %d bytes to channel %d (device-id=%d)...sResult code=%dsChannel write error(RR)R*RRmt
write_channelRFtmax_message_lenRoRVRyRRSR/(	R'RXRRRZt	bytes_outttotal_bytes_to_writeRRO((s/usr/share/hplip/base/device.pyt__writeChannels$	



ic
Cs|djo
ti}n
ti}|tidddti|d||d}ti||i|d|dt	dS(Nit&RtWiR<traw(
RtbuildEmbeddedPML2tbuildEmbeddedPMLtbuildPCLCmdRtbuildEmbeddedPMLSetPacketR)R3R@R2(R'R5RtstyleR<tfuncR((s/usr/share/hplip/base/device.pytwriteEmbeddedPMLs

	

cCs|i|||||S(N(t	printFile(R't	file_nameRR<Rltremove((s/usr/share/hplip/base/device.pyt
printGzipFilesc
Csyti|Wn%tj
otid|dSXti\}}ti|d}|i	}x1|i
dp ti|||i	}qlWg}|i	}x.|i
dp|i||i	}qWht
id6|id6|id6|id6|id	6|id
6|id6|id6}|id
jod|d<nd|d
<d|d<x"|D]}	ti||	|qoWti||i|iti||i||dtdtdtdS(NsFile not found: %sRs	%PY_BEGINs%PY_ENDtVERSIONRRJtBUSRtIPtPORTtDEVNODERsn/aR<RlRv(R0tstatR3R)RVRtmake_temp_filetgzipRtreadlineRR1R<RFtversionR\RRhRRRRtreadRRtR4R2(
R't
print_fileRttemp_file_fdttemp_file_nameRRt	sub_linestSUBSR((s/usr/share/hplip/base/device.pytprintParsedGzipPostscriptsJ












cCs tii|didj}|djo$|i}|pttqSnti	d||||||f|oJ|o#|i
ti|di
q|i
t|di
nVtidpd}|o
d}n|od|||f}nd	|||f}ti	|ti|}	|	d
jotid|	n|oti|qnd\}
}|o
d}
n|o
d
}n|od||
||f}nd||
||f}ti	|ti|}	|	d
jotid|	ndS(Nis.gzsHPrinting file '%s' to queue '%s' (gzip=%s, direct=%s, raw=%s, remove=%s)RtlprRs-orawsgunzip -c %s | lp -c -d%s %sslp -c -d%s %s %sis'Print command failed with exit code %d!s-o raws-rsgunzip -c %s | lpr %s %s -P%sslpr -P%s %s %s %s(RR(R0R[tsplitextRR/RuRyt$ERROR_NO_CUPS_QUEUE_FOUND_FOR_DEVICER)R*R^RRRtfileRRZtsystemRVRv(R'RuRR<RlRvtis_gziptlp_optRt	exit_codetraw_strtrem_str((s/usr/share/hplip/base/device.pyRtsH"
		# 






cCs(|itiitiddd|S(NRtpsstestpage.ps.gz(RR0R[R\RFR](R'R((s/usr/share/hplip/base/device.pyt
printTestPage	scCsg|o|i|nLti\}}ti||ti||i||t|dtdS(NRv(	R^RR~R0R1RRtR4R2(R'RRR<RlRR((s/usr/share/hplip/base/device.pyR@	s
cCs*ti|t|_|i|idS(N(Rt	cancelJobtSTATUS_PRINTER_CANCELINGRiRj(R'tjobid((s/usr/share/hplip/base/device.pyR*	s
	cCsg}|ioy|ii|i\}}Wn)tiij
o}tidgSX|i	x'|D]}|i
tt|qlWy|di
|_Wntj
ot|_nXti|it|_nt|_t|_||_|S(Ns!dbus call to GetHistory() failed.i(R:Rdt
GetHistoryRRSRTRUR)RVtreverseR<RttupleRRiRRRR|RRmRe(R'tresultRthistoryReth((s/usr/share/hplip/base/device.pytqueryHistory0	s(


			c	CsBz0|io)d|iidd|f}|}ndd|i|f}|io@ti|i\}}|tijod||f}qnd}t	i
d|th}y|i||}Wn;t
j
o/t	id||id|in'Xz|i|iWd|iXWd|iXdS(Ns	%s&loc=%sshpfax:shp:shttp://%s%ssOpening: %ssStatus read failed: %si(RdRRRRRmtget_zc_ip_addressRoR/R)R*tLocalOpenerRRyRVtseekttruncateR1RRR(	R'turlRMturl2RRRRXR((s/usr/share/hplip/base/device.pyt	getEWSUrlO	s,



cCst}tiitid|iid}ti	|tii
|oti	d|yc|i|it
i|i}ti	dti||it}ti	dWqtj
o}tid|iqXntid||S(Ntfirmwares.fw.gzs!Downloading firmware file '%s'...s%s bytes downloaded.tOKsAn error occured: %ssFirmware file '%s' not found.(R4R0R[R\RFtdata_dirRRR)R*R^RR^RRRRtcommafyRR2RyRVRA(R'Rt
usb_device_idR<tfilenameRORe((s/usr/share/hplip/base/device.pytdownloadFirmwaren	s (


(NRDRER/R4R(RjRyRgRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRrR(R*R+RtINT_SIZE_INTRR;R2RRFtread_timeoutRORPRQRRRSRTRURKR^R_R`RaRbRcRdR]RsRwRRtRR@RRRR(((s/usr/share/hplip/base/device.pyREs				6		!																												OW	Z			8:								/8
			t	xStringIOcBseZdZRS(cCs|S(N((R'RR((s/usr/share/hplip/base/device.pytmakefile	s(RDRER(((s/usr/share/hplip/base/device.pyR	sRcBseZdZRS(cCs:tid|ti|}|idpd}|idpd}|idpd}|idpd}|idpd}|i|id|t}	x|id	|	d
doqW|	i	dti
|	iti
|	}
|
i|
itijottn|
iSdS(Nsopen_hp(%s)iRiiiisBGET %s HTTP/1.0
Content-Length:0
Host:localhost
User-Agent:hplip

i Ri(R)R*thttp_pat_urlRlRqRRaRRSRR3tgetvaluethttplibtHTTPResponsetbeginRRRyt!ERROR_DEVICE_STATUS_NOT_AVAILABLEtfp(R'RRRRhRRtdevicetloctreplytresponse((s/usr/share/hplip/base/device.pytopen_hp	s(
	

(RDRER(((s/usr/share/hplip/base/device.pyR	s(RRRtos.pathR0R$turllibtStringIORR+tgtcodesRRRtprntRRRRRRtstringsRRmtImportErrortgetenvR)RVtsystexittHPMUD_BUFFER_SIZEt
MAX_BUFFERRR4R:RQRSRRR2R_twarningstsimplefiltertDeprecationWarningtDEFAULT_PROBE_BUSRRR/tDEFAULT_FILTERR	tDEFAULT_BE_FILTERRRRRRRDt	ModelDataRRtRkRptobjectRRGRLRgRRRzRwRRRRRRRxRRRRR
RRRRRtAGENT_TYPE_NONEtAGENT_TYPE_BLACKtAGENT_TYPE_CMYtAGENT_TYPE_KCMtAGENT_TYPE_CYANtAGENT_TYPE_MAGENTAtAGENT_TYPE_YELLOWtAGENT_TYPE_CYAN_LOWtAGENT_TYPE_MAGENTA_LOWtAGENT_TYPE_YELLOW_LOWtAGENT_TYPE_GGKtAGENT_TYPE_BLUEtAGENT_TYPE_KCMY_CMtAGENT_TYPE_LC_LMtAGENT_TYPE_LG_PKt
AGENT_TYPE_LGtAGENT_TYPE_Gt
AGENT_TYPE_PGtAGENT_TYPE_C_MtAGENT_TYPE_K_YtAGENT_TYPE_UNSPECIFIEDRtAGENT_KIND_NONERtAGENT_KIND_SUPPLYtAGENT_KIND_HEAD_AND_SUPPLYtAGENT_KIND_TONER_CARTRIDGEtAGENT_KIND_MAINT_KITtAGENT_KIND_ADF_KITtAGENT_KIND_DRUM_KITtAGENT_KIND_TRANSFER_KITtAGENT_KIND_INT_BATTERYtAGENT_KIND_UNKNOWNR	RRtAGENT_HEALTH_INCORRECTtAGENT_HEALTH_FAILEDtAGENT_HEALTH_OVERTEMPtAGENT_HEALTH_CHARGINGtAGENT_HEALTH_DISCHARGINGRR
RRRtstring_cacheRERt	URLopenerR(((s/usr/share/hplip/base/device.pyt<module>s

$


	ESv		.#	#	'			
			1










Youez - 2016 - github.com/yon3zu
LinuXploit