MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/share/printconf/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/printconf/util/backend.pyo
m
^Dc	@sdZdZedZdZdZdZdZdZdZd	k	Z	d	k
Z
d	kZd	kZd	k
Z
d	kZd	kZd	kZd	kZeid
dZe
iddZeiid
dkTdklZlZeiZdZd	k Z dZ!y/e i ei"dddddg\Z#Z$Wn*e i%j
oe!ei&dnXdZ'dZ(xe#D]zZ)e)ddjoe*ddZPne)ddjoe!ei&dne)ddjoei&e(qqqqWe+dddd pe*d!dZnepe*d"ei&dnd	d	d	d#Z-d$Z.d%Z/d&Z0d'Z1d(Z2d)Z3d*Z4d+Z5d,Z6d-Z7e8ddZ9e:dddd e9pd.GHei&dne9i;d/Z<y'e9i;d0i=Z>de<e?e>_@WnnXeAeiBZCeAeiBZDe
iEee
iFpeAed1iGeCne2d2d3d4d5d6d7d8d9geCZCeCieyeHe<di>ZIWn+ye9i;d0i=ZIWqdZIqXnXdZJdaKgZLxe<D]ZMeHeMi>ZNe*d:eNefe/eMeIeDZDe*d:eNefe1eMeCZCe*d;eeNfeJe4eM7ZJq
We6eJe5tKyDeAeid<ZOeOiBZPeOiQd[OeRd=ePZPWn
gZPnXx]ePD]UZMe*d>eMe.eMeDZDe0eMeCZCye
iSeeMd?WqqXqWd@gZTy%e9i;dAi=ZUeUp
gZTnWnnXyeLeLiVdBgZLWnnXe7eL\ZWZXe*dCeYeLe*dDeYeWe*dEeYeXdZUeZeTo
dZUneUodFgZeidGeidHeZeTdjoeidInxeTD]Z)eidJe)qtWxeXD]Z)eidKe)qWeCi[eneCidLeZeWdjpeWddMjo(dNZ\e\eWjoeWidNqnxeWD]Z)eCidOe)q"WeAed1Z]e]iGeCe]i^eAed1Z]e]iGeDe]i^eIe
i_dP<e
i`dQd	S(Rs/etc/cups/printers.confs/etc/cups/cupsd.confs.saves/etc/cups/ppd/s/etc/cups/mime.typess/etc/cups/mime.convss/etc/cups/lpoptionss.news8# Lines below are automatically generated - DO NOT EDIT
Ntlpitsyss/usr/share/printconf/util(t*(t_sN_icCs	dGHdS(Nsusage: printconf-backends [OPTIONS]

Options:
 --force-rebuild  Force the queues to be rebuilt
 --help           Display this usage message((((t$/usr/share/printconf/util/backend.pythelp_messageOsits
force-rebuildthelpstest-smbcCs#|di}|d}	|djo|	di}
|
iddjo|
Sn|
idod|
Sn|
id	od
|
Sn|
idp|
idod
|
Snd|
Sn|djo,|	di}|	di}d||fSn|djoM|	di}|	di}d}|	dio
d}nd|||fSn|djo,|	di}|	di}d||fSn|djo|	di}|	d i}|	d!i}|	d"i}|	d#i}|od|}n|o|d$}n|id%d$}|o|d&7}n|ido|d'}n@|d(d$jo|d)}n|id$d}|d$|}d*||||fSn|d+joe|	d,i}|	d-i}
|	d.i}|	d/i}|od|d&}nd0||||
fSntd1|d2S(3Nt
queue_typet
queue_datatLOCALtlocal_printer_devicet:is/dev/lps	parallel:s/dev/ttysserial:s/dev/usbs//susb:sfile:tIPPt
ipp_servertipp_paths
ipp://%s%stLPDt
lpd_servert	lpd_queueRtlpd_strict_rfc1179s?reserve=yess
lpd://%s/%s%st	JETDIRECTtjetdirect_iptjetdirect_portssocket://%s:%stSMBt	smb_sharetsmb_ipt
smb_workgrouptsmb_usertsmb_passwordt/s\t@iiissmb://%s%s%s%stNCPt
ncp_servert	ncp_queuetncp_usertncp_passwordsncp://%s%s%s/%ssUnknown queue type: %ssfile:/dev/full(tqueuetvalueRR	tdevtfindt
startswithRRRRtreserveRRRRRRRtreplaceR R!R"R#tdebug_print(R$RRRRR"RRRR	R&RR R!RR#RRRR)((Rt
device_uri]st



 




















cCsdfdY}d}xhd|d<d|d<d|d<d	|d<d
|d<dd<hd|d<d|d<d|d
<d	|d<d
|d<dd<hd|d<d|d<d|d<d	|d<d
|d<dd<hd|d<d|d<d|d
<d	|d<d
|d<dd<hd|d<d|d<d|d<d	|d<d
|d<dd<hd|d<d|d<d|d<d	|d<d
|d<dd<hd|d<d|d<d|d
<d	|d<d
|d<dd<gD]k}hd|d<d|<}t|}||djo!d|d|fGH|d7}n
d|GHqW|SdS(NtdatumcBstZddZRS(NRcCs
||_dS(N(R%tself(R.R%((Rt__init__s(t__name__t
__module__R/(((RR-siRs//server/printerRRRRRtexpectedssmb://server/printert	workgroupssmb://workgroup/server/printertuserssmb://user@server/printers#smb://user@workgroup/server/printers//server/sharetdomainsdomain\usertpasswords.smb://domain\user:password@domain/server/shares"smb://user:password@server/printers,smb://user:password@workgroup/server/printerRRR	sExpected %s; got %sisOK: %s(R-tfailttestR$R,turi(R-R9R$R8R7((Rt
test_smb_urissj1
s--force-rebuildsRebuild forced on command lines--helps
--test-smbt	namespacet	printconftmarkt_PRINTCONF_BACKEND_sNamespace dirtysNo rebuild neededcCstii|oti|ntitiBtiB}|o)ti
|||}ti||nti
||}|o|oti|||nti|d}|S(Ntw(tostpathtexiststfilenametunlinktO_WRONLYtO_CREATtO_EXCLtflagstmodetopentfdtchmodtuidtgidtchowntfdopentfile(RCRIRMRNRHRQRK((Rt
safely_createsc	Csd}x|pd}d}x9ddgD]+}y|i||d}Wq)q)Xq)W|djo]|}y-||d}|d|idd}Wnt|}nX|||5d}n|}q	W|S(Nis	<Printer s<DefaultPrinter s>
is</Printer>
(tfinishedtfoundtNonetlinettagtprinters_conf_linestindexR$t
start_linetresttend_linetlen(	R$RXR[RSRWR\RTRVRZ((Rtremove_printers_confs,



c	CsOt|i}t||}||jo
d}nd}||dg}|i	dt
|y.|i	d|d|i	d|dWnnXy(|d}|d	i}|d
i}Wnd\}}nX|i	d|i	d
|i	d||f|i	d|i	d|i	d|i	d|i||S(Ns<DefaultPrinter s	<Printer s>
s
DeviceURI %s
sLocation %s
tqueue_descriptionsInfo %s
t	jobsheetststarttendtnonesState Idle
sAccepting Yes
sJobSheets %s %s
sQuotaPeriod 0
sPageLimit 0
s	KLimit 0
s</Printer>
(RcRc(tdemangle_queue_nameR$tnamet
queue_nameR^RXt
default_queueRWtconftappendR,R`R%tstart_bannert
end_bannertextend(	R$RgRXRfRjRkRWRhR`((Rtadd_printers_conf-s8	










cCsd}x|pd}xtt|D]w}||d|jo\xDt|dt|D])}||ido|d7}Pq^q^W|||5d}Pq)q)W|}q	W|S(Nis<Location %s>
is
</Location(	RSRTtrangeR]tcupsd_conf_linestitlocationtjR((RqRoRpRrRSRT((Rtremove_cupsd_confWs"
	
	cCst|i}td||}d|g}|id|id|id|idyd}t	i
d||f}t	i
d	}|d
}	xA|	D]9}|i}|djo
d}n|i|od
|}n|i|}|o|i}td|d }td|d}
x+tddD]}
||
c|
|
M<qGW|i|
dt|}n|id|d}x&tD]}||jod}PqqW|pti|qqWWnnX|id|i||S(Ns
/printers/s<Location /printers/%s>
sOrder Deny,Allow
sDeny From All
sAllow From 127.0.0.1
sAuthType None
s&([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)s^%s/%s$s^[a-z]+[0-9]+$tsharingtALLtAlls@IF(%s)cCs
t|S(N(tinttx(Rx((Rt<lambda>sicCs
t|S(N(RwRx(Rx((RRysis%d.%d.%d.%d/%d.%d.%d.%dsAllow from %s
is</Location>
(RdR$ReRfRsRoRhRit
ipaddr_re_strtretcompilet
network_ret	netdev_reRtteachR%tallowedtmatchtgroupstquadtmaptnetworktnetmaskRnRpRlttupleRTt
interfaces(R$RoR~RhRRRfRzRRtRRR}RpRRT((Rtadd_cupsd_confjsX
	





	



	

cCsd}x|pd}xtt|D]o}||tjo||=d}n<x8|D]0}||i	|do||=d}PqXqXW|oPq)q)W|}q	W|S(Niit (
RSRTRnR]RoRptautogentoptsRR((RRoRpRSRRT((Rtremove_cupsd_conf_globalss&
		c
CsJt|i}ytti}Wn
g}nXy|d}	Wnt	i
}	nXd|}x,|	iD]}|d||	|f7}qmW|d7}d}xftt|D]R}||id}t|djo&|d|jo|||<d}PqqW|p|i|nttd}|i||id	S(
sSet the filter options.t	lpoptionssDest %ss %s=%ss
iRiR?N(RdR$ReRfRQRt	readlinestopttoptionsRhtdefault_lpoptionststrtkeystoRTRnR]RptsplittwordsRitft
writelinestclose(
R$RRRpRfRRRTRR((Rtset_filter_optionss8




$
	
cCst|i}d0}d}h}	|di}|t
ii	jo|ddit
iijo|d}|di}|di}d||f}ti|}|i}|io
dGHdSn|d	}
x||
D]*}
|
d
i}|
di}||	|<qWnG|t
ii	jo|ddit
iijordd
}ti|}|i}|io
dGHdSn|d}y|di}||	d<WqQqQXn|t
ii	jo|ddit
iijotdtdi}|d}yB|ddi}|od|	d<nd|	d<td|WnnXy~|ddi}|obd}d}xS|D]G}|i"ddjo!|i#||i$ddPn|d}qWnWqQqQXnu|t
i%i	joTtd|yti&t'|dWnnX|t
i%i	jodSndSnd|GHdS|p
d GHdSntd!y,|	d}||	d"<||	d#<||	d$<WnnXx|	i(D]~}d%|}d}xQt,t-|D]=}||i/|o#d&||	|f||<d}PqqW|p
d'|GHqqWt0|y|dd(i}Wn
d)}nX|d*jp'|d+jp|d,jp
|d-jo|i2d.da3d}nt'|d}t5|t6d/}|i8||iti9|t6||S(1s.Returns 1 if the queue is raw and 0 otherwise.itfilter_typetfilter_datatmf_typet
printer_idt	gs_drivers%/usr/bin/foomatic-ppdfile -d %s -p %ssError generating PPD filetfoomatic_defaultsRetdefaults/bin/gzip -dc %ss'/usr/share/cups/model/postscript.ppd.gzt	page_sizetPageSizesText-only printers"/usr/share/cups/model/textonly.ppdRHtsend_FFtTruetSendFFtFalses
SendFF: %stassume_data_is_textis
text/plainisapplication/octet-streamsNo PPD file needed (%s)s.ppdsUnknown filter type: %ssCouldn't generate PPDs"PPD generated.  Adjusting options.t
PageRegiont
ImageableAreatPaperDimensions*Default%s:s*Default%s: %s
sNo %s option to change!t
filter_localetCtja_JPtko_KRtzh_CNtzh_TWsK*% CJK [This line causes text conversion to use the appropriate utilities]
iN(:RdR$ReRfRUtppdtoctet_stream_allowedRR%RtdriverstfoomaticRRtprintertdrivertdatafile_cmdR@tpopentppd_pipeRRRtoption_defaultt
postscripttpostscript_cmdtpagettextR+RQtsendfftcodesRpRVR'tinsertR*trawtremovetppd_dirRtoptiontsearchRTRnR]tnR(RRRit
cjk_neededRCRRt
new_suffixRRtrename(R$RRRRRRRfRCRRRRRRRRRRVRRReRRpR%RRTR((Rt
create_ppds
1






1



1


		
	





	

4



cCsd}
d}d}d}tti}xtt	|D]}y4||i}|di
}	|di
}Wn
q=nX|	|
joq=n||jo|o|}d}n&||jo|o|}d}n|o'd|	|d|d|f||<Pq=q=W|oa|otd	ntd
tttd}|i||ititttndS(
s7Set or unset cjktexttops as the handler for text/plain.s
text/plainttexttopstcjktexttopsiiis
%s		%s	%s	%s
is Using cjktexttops for text/plainsUsing texttops for text/plainiN(ttypeRRtmodifiedRQt
mime_convsRtlsRnR]RpRtfieldststript	this_typethandlertuse_cjktexttopsR+RRRtmRRR@R(RRpRRRRRRRRR((Rtadjust_mime_convs`sB


"	


cCsrd}tid|}tti}d}d}xt
t|D]}||i
|jo5|odSnd}td|d|||<qJ|i||o2d}|o!td|d	|||<PqqJqJW|o+|o#td
||id	|n|o|odSntttd}|i||ititttdS(ssSet or unset 'application/octet-stream' in the mime.types file.
    It needs to be set if there are any raw queues.sapplication/octet-streams^# *%s$iNisDisabling %s MIME types# %s
sEnabling %s MIME types%s
sAdding %s MIME typei(RR{R|t	commentedRQt
mime_typesRRtfound_commentedtfound_uncommentedRnR]RpRtallow_octet_streamR+RRiRRRRRRR@R(RRpRRRRRR((Rtadjust_mime_typess:


csg}g}d}
tid|
}tid|
|
f}tid}x|D]}|djodg}dg}Pn|i
|}|o|i}t
d|d	}xtiiD]}ytii|}tii|}	|i
|}|i
|	}t
d
|it
d|it
dtd
}t
dtd
}
||
jotii|}|i
|}t
d|idt}tii |}|i
|}t
d|i}dt|}||jo|i$|n||jo|i$|nd}PnWqqXqW|p
dg}qTqTn|i
|}|o|id	}ytii|}tii |}|i
|}|i
|}dtt
d|idtt
d|i}|jo|i$n||jo|i$|nWqTqTXqTn|i
|}|o|i}t
d|d
 t
d|d
x+td	d
D]}|c|M<qWx@tiiD]/}ytii|}|i
|}t
d|it
dtd
}t
dtd
}||jotii |}|i
|}t
d|i}dt|}dt}||jo|i$|n||jo|i$|q<nWqqXqWqTqTqTW|i+do
dg}n|i+do
dg}n||fS(sGiven a list of interface specifications (allow from ...),
    return a tuple of arrays representing IP addresses and broadcast
    addresses for each relevant interface.  Do this by parsing
    /etc/sysconfig/network-scripts/* if necessary.s&([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)s^%s$s^%s/%s$s
^@IF\((.*)\)$RvRs255.255.255.255cCs
t|S(N(RwRx(Rx((RRysicCs
t|S(N(RwRx(Rx((RRyscCs
t|S(N(RwRx(Rx((RRyscs||@S(N(tipnRxtnmn(Rx(RR(RRysics||@S(N(t
ipallowednRxR(Rx(RR(RRyscCs
t|S(N(RwRx(Rx((RRyss%d.%d.%d.%dcCs
t|S(N(RwRx(Rx((RRysicCs
t|S(N(RwRx(Rx((RRyscCs
t|S(N(RwRx(Rx((RRyscCs
t|S(N(RwRx(Rx((RRyscCs
t|S(N(RwRx(Rx((RRyscCs
t|S(N(RwRx(Rx((RRyscs||@S(N(RRxR(Rx(RR(RRyscs||@S(N(RRxR(Rx(RR(RRyscCs
t|S(N(RwRx(Rx((RRysN(,tipaddrt	broadcastRzR{R|t	ipaddr_reR}tif_reRRRRRRRRTtrhpltethtooltget_devicesR&t
get_ipaddrtipstget_netmasktnmstipmatchtnmmatchRRRntnwnt
nwallowednRt
get_broadcasttbcstbcmatchtbcnRiRRRptspntbctiptcount(RRRRRRRRRRRRRRzRRRRRRRRR}RpR&RRRRTR((RRRRRRtgrok_sysconfig_filess
		


	







sError getting contexts/printconf/print_queuess/printconf/default_queueR?tBrowsingtBrowseProtocolstBrowseOrdertBrowseAllowt
BrowseDenyt
BrowseAddresstListentPortsAdd '%s' configuration to %ssCreate %s%s.ppdsr+cCs
|iS(N(RxR(Rx((RRyissRemove '%s' configurations.ppds@LOCALs#/printconf/sharing_globals/browsingRvsFor interfaces: sipaddr: sbroadcast: sBrowsing On
sBrowseProtocols cups
sBrowseOrder Deny,Allow
sBrowseDeny from All
sBrowseAllow from %s
sBrowseAddress %s
s
Browsing Off
Rs	127.0.0.1sListen %s:631
tDEFAULTs5/usr/bin/lpoptions -d $DEFAULT >/dev/null 2>/dev/null(at
printers_conft
cupsd_conftcupsd_conf_backupRRRRRRtglobR@RtpwdtgrpR{tsignaltrhpl.ethtoolRtcups_importtgetpwnamtlp_uidtgetgrnamtsys_gidRARitprintconf_conftrhpl.translateRtN_Rhtremoval_printconftrebuildtgetoptRtargvRtargsterrortexitR,R:RR+tcheckNspMarkRURRR^RmRsRRRRRRRtreadNsptcontexttmarkNsptdatatprint_queuesR%Retmangle_queue_nametposRQRRoRXtaccesstF_OKRRdRgt
raw_queuesRRR$Rftrt	to_removettruncateRRtbrowse_interfacestbrowsingRYRRRR]Rlt	localhostRRtenvirontsystem(=RfRsRRRR,RhR!RRRgRRRXRRRRR{R
R'RoRRRRR,RRR:RRRRRRR^RRR	RRReRRR
RR*RR(RR$RR&RRRRRmR@RR+((Rt?sL
											M	B
	



		*		4		$		*	#	|
	
		



	

	


$







Anon7 - 2021