%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/shlex.pyo


Mac@sdZddlZddlZddlmZyddlmZWn!ek
reddlmZnXddgZ	dddYZ
eedZ
ed	kreejd
kre
Zn"ejd
Ze
eeeZx,ejZer
deeGHqPqWndS(
s8A lexical analyzer class for simple shell-like syntaxes.iN(tdeque(tStringIOtshlextsplitcBszeZdZddedZdZddZdZdZ	dZ
dZdddZd	Z
d
ZRS(s8A lexical analyzer class for simple shell-like syntaxes.cCs<t|trt|}n|dk	r?||_||_ntj|_d|_||_|rod|_	n	d|_	d|_
d|_|jr|jd7_nd|_t
|_d|_d|_d|_d	|_t|_d
|_d|_d|_t|_d|_|jr8d|j|jfGHndS(
Ntt#t?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_s>s 	
s'"s\t"t iisshlex: reading from %s, line %d(t
isinstancet
basestringRtNonetinstreamtinfiletsyststdintposixteoft
commenterst	wordcharst
whitespacetFalsetwhitespace_splittquotestescapet
escapedquoteststateRtpushbacktlinenotdebugttokent	filestacktsource(tselfRR
R((s!/usr/local/lib/python2.7/shlex.pyt__init__s<																		cCs5|jdkr!dt|GHn|jj|dS(s:Push a token onto the stack popped by the get_token methodisshlex: pushing token N(RtreprRt
appendleft(R!ttok((s!/usr/local/lib/python2.7/shlex.pyt
push_token;scCst|trt|}n|jj|j|j|jf||_||_d|_|jr|dk	rd|jfGHqd|jfGHndS(s9Push an input source onto the lexer's input source stack.isshlex: pushing to file %ssshlex: pushing to stream %sN(
R	R
RRR$R
RRRR(R!t	newstreamtnewfile((s!/usr/local/lib/python2.7/shlex.pytpush_sourceAs"				cCs\|jj|jj\|_|_|_|jrOd|j|jfGHnd|_dS(sPop the input source stack.sshlex: popping to %s, line %dRN(RtcloseRtpopleftR
RRR(R!((s!/usr/local/lib/python2.7/shlex.pyt
pop_sourceOs
!	cCs/|jr=|jj}|jdkr9dt|GHn|S|j}|jdk	rx\||jkr|j|j}|r|\}}|j||n|j	}q[Wnx9||j
kr|js|j
S|j|j	}qW|jdkr+||j
kr#dt|GHq+dGHn|S(sBGet a token from the input stream (or from stack if it's nonempty)isshlex: popping token s
shlex: token=sshlex: token=EOFN(
RR+RR#t
read_tokenR Rt
sourcehookR)t	get_tokenRRR,(R!R%trawtspecR(R'((s!/usr/local/lib/python2.7/shlex.pyR/Xs.		
cCs}t}d}xtr|jjd}|dkrF|jd|_n|jdkrxdGt|jGdGt|GHn|jdkrd|_	Pq|jdkr|sd|_Pq||j
kr|jdkrd	GHn|j	s|jr|rPqqq||jkr-|jj
|jd|_q|jrW||jkrWd
}||_q||jkr{||_	d
|_q||jkr|js||_	n||_q|jr||_	d
|_q||_	|j	s|jr|rPqqq|j|jkrt}|s5|jdkr)dGHntdn||jkrv|jsj|j	||_	d|_Pqd
|_q|jr||jkr|j|jkr|j}||_q|j	||_	q|j|jkr_|s|jdkrd
GHntdn||jkrC||jkrC||krC|j	|j|_	n|j	||_	||_q|jd
kr|sd|_Pq||j
kr|jdkrdGHnd|_|j	s|jr|rPqqq||jkr5|jj
|jd|_|jrd|_|j	s(|jr|rPq2qqq|jrY||jkrY||_q|jr||jkrd
}||_q||jks||jks|jr|j	||_	q|jj||jdkrdGHnd|_|j	s|jr|rPqqqqW|j	}d|_	|jrJ|rJ|dkrJd}n|jdkry|rqdt|GHqydGHn|S(NRis
isshlex: in statesI see character:Ris+shlex: I see whitespace in whitespace statetas shlex: I see EOF in quotes statesNo closing quotations shlex: I see EOF in escape statesNo escaped characters%shlex: I see whitespace in word states&shlex: I see punctuation in word statesshlex: raw token=sshlex: raw token=EOF(RtTrueRtreadRRR#RRRRRRtreadlineRRRRt
ValueErrorRRR$(R!tquotedtescapedstatetnextchartresult((s!/usr/local/lib/python2.7/shlex.pyR-xs			
										
					
			cCs|ddkr |dd!}nt|jtrltjj|rltjjtjj|j|}n|t|dfS(s(Hook called on a filename to be sourced.iRiitr(	R	R
R
tostpathtisabstjointdirnametopen(R!R(((s!/usr/local/lib/python2.7/shlex.pyR.s
%'cCs>|dkr|j}n|dkr0|j}nd||fS(s<Emit a C-compiler-like, Emacs-friendly error-message leader.s"%s", line %d: N(RR
R(R!R
R((s!/usr/local/lib/python2.7/shlex.pyterror_leaders
cCs|S(N((R!((s!/usr/local/lib/python2.7/shlex.pyt__iter__	scCs(|j}||jkr$tn|S(N(R/Rt
StopIteration(R!R((s!/usr/local/lib/python2.7/shlex.pytnexts	N(t__name__t
__module__t__doc__RRR"R&R)R,R/R-R.RBRCRE(((s!/usr/local/lib/python2.7/shlex.pyRs$				 				cCs7t|d|}t|_|s-d|_nt|S(NRR(RR3RRtlist(tstcommentsRtlex((s!/usr/local/lib/python2.7/shlex.pyRs
	t__main__isToken: ((RHtos.pathR<RtcollectionsRt	cStringIORtImportErrort__all__RRR3RRFtlentargvtlexertfileRAR/tttR#(((s!/usr/local/lib/python2.7/shlex.pyt<module>s(



Zerion Mini Shell 1.0