
    dU2                     h   d Z dZddlZddlZddlmZ ddlmZ ddlmZ ddlZddlm	Z	 ddl
Z
 ee
      D  cg c]   } | j                  d	      s| d
vr	 ee
|       " c} ZdZ ee
      D  cg c]   } | j                  d	      s| evr	 ee
|       " c} Z	 ej#                   edj&                                G d dej*                        Z G d dej.                        Z G d dej2                        Z G d dej6                        Z G d dej:                        Zyc c} w c c} w # e$ r Y {w xY w)zdFilling is the gui tree control through which a user can navigate
the local namespace or any object.z(Patrick K. O'Brien <pobrien@orbtech.com>    N   )
dispatcher)
editwindow)images)
introspect_)	ClassTypeInstanceType
ModuleType)BuiltinFunctionTypeBuiltinMethodTyper	   FunctionTypeGeneratorTyper
   
LambdaType
MethodTyper   UnboundMethodTypezmethod-wrapper c                       e Zd ZdZdZdej                  ej                  ej                  ddddfdZ	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zd ZddZd Zd Zy)FillingTreezFillingTree based on TreeCtrl.zFilling TreeNFc
                 f   t         j                  j                  | |||||       || _        ddl}
||
j
                  }d| _        ||
j
                  u r|d}|sd}| j                  |dd|      x| _        | _        | j                  | j                  | j                  |             | j                  t         j                  | j                  | j                                | j                  t         j                  | j                   | j                                | j                  t         j"                  | j$                  | j                                | j                  t         j&                  | j(                  | j                                |	s"t+        j,                  | j.                  d	       yy)
zCreate FillingTree instance.r   NTzlocals()Ingredientsr   )idInterpreter.pushreceiversignal)wxTreeCtrl__init__rootIsNamespace__main____dict__AddRootitemrootSetItemHasChildrenobjHasChildrenBindEVT_TREE_ITEM_EXPANDINGOnItemExpandingGetIdEVT_TREE_ITEM_COLLAPSEDOnItemCollapsedEVT_TREE_SEL_CHANGEDOnSelChangedEVT_TREE_ITEM_ACTIVATEDOnItemActivatedr   connectpush)selfparentr   possizestyle
rootObject	rootLabelr!   staticr"   s              //usr/lib/python3/dist-packages/wx/py/filling.pyr    zFillingTree.__init__+   sM   
 	T62sD%@.!**J#'D ***y/@"I%I $YB
 KK	DI		4+>+>z+JK		",,d.B.Btzz|	T		",,d.B.Btzz|	T		"))4+<+<	N		",,d.B.Btzz|	T		:LM     c                 l    | s"t        j                  | j                  d       y| j                          yz%Receiver for Interpreter.push signal.r   r   N)r   
disconnectr4   displayr5   commandmores      r=   r4   zFillingTree.pushC   &    !!499=OPr>   c                     t        j                         }|j                         }| j                  |      ry| j	                  |       y)zAdd children to the item.N)r   
BusyCursorGetItem
IsExpandedaddChildrenr5   eventbusyr%   s       r=   r+   zFillingTree.OnItemExpandingJ   s5    }}}}??4 r>   c                 L    t        j                         }|j                         }y)z"Remove all children from the item.N)r   rH   rI   rL   s       r=   r.   zFillingTree.OnItemCollapsedS   s    }}}}r>   c                 v    t        j                         }|j                         | _        | j	                          y)z#Display information about the item.N)r   rH   rI   r%   rB   )r5   rM   rN   s      r=   r0   zFillingTree.OnSelChanged[   s#    }}MMO	r>   c                     |j                         }| j                  |      }| j                  |      }t        | d||d      }|j	                          y)zLaunch a DirFrame.)X  d   F)r6   r8   r:   r;   r!   N)rI   getFullNameGetItemDataFillingFrameShow)r5   rM   r%   textobjframes         r=   r2   zFillingTree.OnItemActivateda   sL    }}%t$Dzc'+UD

r>   c                 (    | j                  |      ryy)z#Return true if object has children.TF)objGetChildren)r5   rY   s     r=   r(   zFillingTree.objHasChildrenj   s    s#r>   c                    t        j                         }t        |      }t        |t              s#dt        j                  |      v rt        |d      r|S i }t        |t        t        f      r<t        t        |            D ]%  }dt        j                  |      z   dz   }||   ||<   ' |t        vr*t        j                  |      D ]  }	 t        ||      ||<    |S # t         $ r Y "w xY w)z8Return dictionary with attributes or contents of object.BTreeskeys[])r   rH   type
isinstancedictsix	text_typehasattrlisttuplerangelenCOMMONTYPESr   getAttributeNamesgetattr	Exception)r5   rY   rN   otypednkeys          r=   r\   zFillingTree.objGetChildrenq   s    }}S	sD!3==//V$JcD%=)3s8_  CMM!,,s2Q#  #!33C8 $S#.AcF  ! s   
C	C)(C)c                    | j                  |       | j                  |      }| j                  |      }|sy t        |d       }|D ]  }t	        j
                  |      }t        |t              rOt        |t        j                        r5|| j                  k7  s|| j                  k(  r| j                  st        |      }||   }| j                  |||      }| j                  || j                  |              y )Nc                 H    t        j                  |       j                         S N)re   rf   lower)xs    r=   <lambda>z)FillingTree.addChildren.<locals>.<lambda>   s    cmmA.>.D.D.F r>   )rs   )r6   rX   data)DeleteChildrenrU   r\   sortedre   rf   rc   rd   string_typesr&   r!   repr
AppendItemr'   r(   )	r5   r%   rY   childrenr_   rs   itemtextchildbranchs	            r=   rK   zFillingTree.addChildren   s    D!t$&&s+h$FG 	HC}}S)H #t$3 0 01"TYY&t/C/C9SME__Dxe_LF##FD,?,?,FG	Hr>   c                    | j                   }|sy | j                  |      r| j                  |       | j                  d       | j	                  |      }t
        j                  dk(  r|y | j                  || j                  |             t        |      }d}|| j                  |      z  }|dt        j                  |      z   z  }	 t        j                  |      }t        |t        j                        rt!        |      }|d|z   z  }|t"        vr-	 |dt%        j&                  |      j)                         z   dz   z  }t        |t        j*                        r'	 |dt%        j,                  |j.                        z   z  }n	 |dt%        j,                  |      z   z  }| j                  |       y # t        $ r d}Y w xY w# t        $ r Y w xY w# t        $ r Y =w xY w# t        $ r Y Lw xY w)	Nr   	__WXMSW__z

Type: z	

Value: z

Docstring:

"""z"""z

Class Definition:

z

Source Code:

)r%   rJ   rK   setTextrU   r   Platformr'   r(   rb   rT   re   rf   ro   rc   r}   r~   SIMPLETYPESinspectgetdocstripclass_types	getsource	__class__)r5   r%   rY   rp   rX   values         r=   rB   zFillingTree.display   s   yy??4 T"Rt$;;+%{d&9&9#&>?S	  &&s}}U333	MM#&E c3++,IE&&#/s+11346;< < c3??+3))#--89 9
.))#./ / 	T/  	E	      sH   F. ,F? %G G .F<;F<?	G
G	GG	G)(G)c                 T   | j                  |      }d}d}|| j                  k7  r"| j                  |      }| j                  |      }t	        |t
              s,dt        j                  t        |            v rMt        |d      rA|| j                  k7  r|| j                  k7  s|| j                  k(  r| j                  sd|z   dz   }|r|d   dk(  r||z  }n|d|z   z  }|| j                  k7  r|| j                  k7  s|| j                  k(  r| j                  s| j                  ||      }|S )	z,Return a syntactically proper name for item.Nr^   r_   r`   ra   r   .)partial)GetItemTextr&   GetItemParentrU   rc   rd   re   rf   rb   rg   r!   rT   )r5   r%   r   namer6   rY   s         r=   rT   zFillingTree.getFullName   s   %499''-F""6*C T"3==c33V$$))#$))(;$))#D,@,@:#DqzS g% DII&DII"5dii(<(<##FD#9Dr>   c                     t        |       y)z0Display information about the current selection.Nprintr5   rX   s     r=   r   zFillingTree.setText       
 	dr>   c                     t        |       y)zDisplay status information.Nr   r   s     r=   setStatusTextzFillingTree.setStatusText   r   r>   )r   )__name__
__module____qualname____doc__r   r   DefaultPositionDefaultSizeTR_DEFAULT_STYLEr    r4   r+   r.   r0   r2   r(   r\   rK   rB   rT   r   r    r>   r=   r   r   &   sr    (D"$"*<*<nnB,?,? D%N00H*)V:r>   r   c                   n    e Zd ZdZdZdej                  ej                  ej                  dfdZ	d Z
d Zy)	FillingTextz$FillingText based on StyledTextCtrl.zFilling Textr   Fc                     t         j                  j                  | |||||       | j                  d       | j	                  d       | j                  dd       |s"t        j                  | j                  d       yy)zCreate FillingText instance.Tr   r   r   r   N)	r   
EditWindowr    SetReadOnlySetWrapModeSetMarginWidthr   r3   r4   )r5   r6   r   r7   r8   r9   r<   s          r=   r    zFillingText.__init__   sk     	&&tVRdEJAq!		:LM r>   c                 l    | s"t        j                  | j                  d       y| j                          yr@   )r   rA   r4   RefreshrC   s      r=   r4   zFillingText.push  rF   r>   c                     | j                  d       t        j                  j                  | g|i | | j                  d       y )NFT)r   r   r   SetText)r5   argskwdss      r=   r   zFillingText.SetText  s<    %%d:T:T:r>   N)r   r   r   r   r   r   r   r   CLIP_CHILDRENr    r4   r   r   r>   r=   r   r      s7    .D"$"*<*<nnB,<,<
Nr>   r   c            	           e Zd ZdZd Zdej                  ej                  ej                  ej                  z  dddddf	dZ
d Zd Zd	 Zy)
Fillingz"Filling based on wxSplitterWindow.r   zFilling WindowNFc           	      \   t         j                  j                  | ||||||       t        | |||	|
      | _        t        | |
      | _        t        j                  d| j                  | j                  | j                  d       | j                  d       | j                  j                  | j                  _        | j                  j                  | j                  j                         | j                  j                          | j                  t         j                   | j"                         y)zCreate a Filling instance.r6   r:   r;   r!   r<   )r6   r<         r   N)r   SplitterWindowr    r   treer   rX   	CallLaterSplitVerticallySetMinimumPaneSizer   r   
SelectItemr&   rB   r)   EVT_SPLITTER_SASH_POS_CHANGED	OnChanged)r5   r6   r   r7   r8   r9   r   r:   r;   r!   r<   s              r=   r    zFilling.__init__  s    
 	""4S$tLt
*30?'-/	  tF;	
R--tyy$))SI" !II--		 			TYY^^,				"22DNNCr>   c                      y rv   r   )r5   rM   s     r=   r   zFilling.OnChanged2  s     	r>   c                 <   |j                  dd      }| j                         s&| j                  | j                  | j                         t        j                  d| j                  |       |j                  dd      }|dk7  r| j                  j                  |       y y )NSash/FillingPosr      View/Zoom/Fillingi)	ReadIntIsSplitr   r   rX   r   r   SetSashPositionSetZoom)r5   configr7   zooms       r=   LoadSettingszFilling.LoadSettings8  sy    nn.4||~  DII6
S$..4~~1373;IId# r>   c                     |j                  d| j                                |j                  d| j                  j                                y )Nr   r   )WriteIntGetSashPositionrX   GetZoom)r5   r   s     r=   SaveSettingszFilling.SaveSettingsA  s6    )4+?+?+AB+TYY->->-@Ar>   )r   r   r   r   r   r   r   r   SP_3DSP_LIVE_UPDATEr    r   r   r   r   r>   r=   r   r     sO    ,D"$"*<*<nnBHHR5F5F,F&4uD4$Br>   r   c            
       X    e Zd ZdZdZdddej                  dej                  ddddf
dZy)	rV   z.Frame containing the namespace tree component.zFilling FrameNr   	PyFilling)rR   i  Fc           	      N   t         j                  j                  | ||||||       d}| j                          | j	                  |       | j                  t        j                                t        | |||	|
      | _	        | j                  | j                  j                  _        y)zCreate FillingFrame instance.z,PyFilling - The Tastiest Namespace Inspectorr   N)r   Framer    CreateStatusBarSetStatusTextSetIconr   	getPyIconr   fillingr   r   )r5   r6   r   titler7   r8   r9   r:   r;   r!   r<   intros               r=   r    zFillingFrame.__init__L  s    
 	$E3eD>5!V%%'(dz)2/>&,.
 +/*<*<'r>   )	r   r   r   r   r   r   r   DEFAULT_FRAME_STYLEr    r   r>   r=   rV   rV   G  s3    8D"r''j--$u=r>   rV   c                       e Zd ZdZd Zy)Appz!PyFilling standalone application.c                     t               | _        | j                  j                  d       | j                  | j                         y)NT)rV   fillingFramerW   SetTopWindow)r5   s    r=   OnInitz
App.OnInita  s7    (Nt$$++,r>   N)r   r   r   r   r   r   r>   r=   r   r   ^  s
    +r>   r   )r   
__author__r   re   r   r   r   r   r   r   typesdir
startswithrn   rl   DOCTYPESr   appendrb   __repr__AttributeErrorr   r   r   r   r   r   r   rV   r   )ts   0r=   <module>r      s:  & 8
 
 
       +.e* IQll3'GG ua  I3
 +.e* ?Qll3'AX,= ua  ?
	tBKK()
L"++ L^*'' <0Bb 0Bh=288 =."&& Y
I?  		s   %D+%D$!D) )D10D1