%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyo

�
;�Pc@ssdZdefd��YZddd��YZd�Zd�Zd�Zd�Zd	seed
kroe�ndS(
s�
Handling of tree structures given in a special 'dotted' syntax.
This represents trees of nodes with strings as tags,
in a readable and writable and easy to parse syntax.

There are two main functions, unparse_sexpr and parse_string.
When parsing, the result is by default given in 'sexpr' format:
each node is a tuple of the form

    (tag, ) or (tag, node) or (tag, node, node) ...

The following invariant is intended to hold for every node x, 

    parse_string(unparse_sexpr(x)) == x

Currently the following invariant has been tested for some strings:

    unparse_sexpr(parse_string(s)).strip() == s.strip()

[It only holds on stripped results but may be fixed sometime.]

tNodecBs)eZdZd�Zd�Zd�ZRS(ttagtchildrentindexcCs||_||_||_dS(N(RRR(tselfRRR((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt__init__s		cCs0|jftg|jD]}|j�^q�S(N(RttupleRtas_sexpr(Rtc((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR!scCs#d|jj|j|j|jfS(Ns%s(%r, %r, %r)(t	__class__t__name__RRR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt__repr__$s
	(RRR(R
t
__module__t	__slots__RRR(((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyRs		t_GLUECLAMP_cBs�eZdZdZdZdZd�Zd�ZeZdd�Z
dd�Zdd	�Zdd
�Z
d�Zd�Zd
�ZRS(s_parent.FileIO:IOtnodetdotchart.s\cCs|ft|�S(N(R(RRRt	lineindex((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt
node_sexprIscCst|t|�|�S(N(RR(RRRR((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt	node_nodeTscCs|j|jj|�|�S(N(tparse_stringtIOt	read_file(Rtfiletsrc((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt
parse_fileYscCs�|j}|j}g}|}	xUy|j�\}}
Wntk
rQd}
PnX|
j|�sq|j|
�q!Pq!Wx[t|�D]M\}}|j||�s�|j|||�r�|t|�||<q�q�W|dgkr�d}ndj	|�}x�|
dksDt|
�|ksD|
||ksD|
j||d�r`||
|j
|||	�fSt|
�|dkr�|
|d|kr�|dkr�td�q�|jd|�n|j
|d|
|dg|||�\}}
}
|j|
�q�WdS(Nts
isLevel must increase with 1 max(Rt	quotechartnextt
StopIterationtNonet
startswithtappendt	enumeratetlentjoinRtSyntaxErrorterrort
parse_iter(RtposRRtitRRRRt	firstlineRtitttchild((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR'gs@		
	*cCs4t|�}|jdgd||�\}}}|S(Ni(R"R'(RtlinesRR)RRR((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pytparse_lines�s$cCs.|r|jd�}ng}|j||�S(Ns
(tsplitR/(RtstringRR.((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR�scCs|j|j��S(N(t
unparse_sexprR(RR((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pytunparse_node�scs5g����fd���d|�dj��S(NcsG�j�j||d��x#|dD]}�|d|�q(WdS(Nii(R!tunparse_tag(tdepthtsexprtx(tliRtunparse(sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR9�sis
(R$(RR6((R8RR9sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR2�s
cCs�|j|j}}|jd�}xMt|�D]?\}}|j|�s]|j||�r/||||<q/q/Wdj|�}|||}|S(Ns
(RRR0R"R R$(RR5RRRR+R,((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR4�s(s_parent.FileIO:IO(RRN(R
Rt	_imports_t	_chgable_RRRRRRRR'R/RR3R2R4(((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR.s
		'
		cs�ddlm}|�jjj��j�_�j}�j}x(dd'gdd(gddd)fgddd*fgdd	d+fgdddd,ffgd
dd-dd.d/ffgdd0gddd1fgdd2gddd3fgdd4gddd5fgdd6gdd7gdd8gddddd9d:ffd"d;ffggD]'\}}||�}|dk	r@q@q@W�j	�j
dddg�ddl�����fd$��x8td%�D]*}�d&�}||�}||�}q�WdS(<Ni����(tRootRtas.asa
.btbsa
b
.csa
bRs
.a
..as
shello
.a
.b
..ba
x
..bbthellosba
xtbbs\.Rs.\.s\s.
\s
\s\\.s. tags tagt s
as�
initial
text
.aspect for guppy.hsp
..returns
...type A
...latex
~\
\..~|begincolorbox|~raw::~LaTeX~\
~\
~~~{	extbackslash}{	extbackslash}begin{\{}center{\}}~\
.aspect for guppy.gsl
..contains DottedTree
s

initial
textsaspect for guppy.hsptreturnsstype Asclatex
~\
..~|begincolorbox|~raw::~LaTeX~\
~\
~~~{	extbackslash}{	extbackslash}begin{\{}center{\}}~\saspect for guppy.gslscontains DottedTree
csj�jd|�}�j��dj��}gt|�D]}�|d�^q;}�j||d�S(NiRi(trandinttshuffleR$trangeR(tmaxchildtnumchildRR+R(tcharstdttrandnodetrandom(sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyRJs

)i
i(R(R=(R=(R>(R(R=(R=(sba
x(R@(R(R(s\(s
\(s\.(s tag(RA(s
(s
a(stype A(sclatex
~\
..~|begincolorbox|~raw::~LaTeX~\
~\
~~~{	extbackslash}{	extbackslash}begin{\{}center{\}}~\(scontains DottedTree
(
tguppyR<tgslt
DottedTreeRRRR2RRRRKRE(R<tparseR9R7tytzR+((RHRIRJRKsG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyttest_1�sT											cCs�ddlm}|�jjj}|j}|j}|d�}tdtdtddd�fd�td	d
d
�fd�}|GHdS(Ni����(R<s'line 0
.line 1
..line 2
line 3
.line 4
sline 0sline 1s
line 2
line 3iisline 4
ii(((RLR<RMRNRR3R(R<RIROR9Rtexp((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyttest_2s			cCs+ddl}ddl}|j|jj�S(Ni����(tdoctesttguppy.gsl.DottedTreettestmodRMRN(RURL((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyttest_doctest/scCst�t�dS(N(RRRT(((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt	test_main3sit__main__N((	t__doc__tobjectRRRRRTRXRYR
(((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt<module>s�	Z			

Zerion Mini Shell 1.0