~repos /sabel-ide

#python#qt

git clone https://pyrossh.dev/repos/sabel-ide.git

sabel-ide



file:

Widget/ipython.pyc



�
�'Pc@s�ddlZddlZddlZddlZddlTddlTdefd��YZdefd��YZ e
dkr�e ej �Z ed�Zej�eje j��ndS(i����N(t*t MyInterpretercBseZd�Zd�ZRS(cCs�tt|�j|�t�}|j|�t|�|_|jjt��|j dd�|j
�|j |j�|j d�|j d�dS(Ni�i,i(tsuperRt__init__t QHBoxLayoutt setLayouttPyInterpttextEdittinitInterpretertlocalstresizetcenterOnScreent addWidgett setMargint
setSpacing(tselftparentthBox((sC:\CODE\Sabel\Widget\ipython.pyR s  
 cCs_t�j�}|j|j�d|j�j�d|j�d|j�j�d�dS(Ni(tQDesktopWidgettscreenGeometrytmovetwidtht frameSizetheight(Rt
resolution((sC:\CODE\Sabel\Widget\ipython.pyR s'(t__name__t
__module__RR (((sC:\CODE\Sabel\Widget\ipython.pyR s RcBs~eZdejfd��YZd�Zd�Zd�Zd d�Zd�Z d�Z
d�Z d �Z d
�Z d �ZRS( tInteractiveInterpretercBseZd�Zd�ZRS(cCstjj||�dS(N(tcodeRR(RR ((sC:\CODE\Sabel\Widget\ipython.pyR'scCstjj||�dS(N(RRt runsource(Rtcommand((sC:\CODE\Sabel\Widget\ipython.pytrunIt*s(RRRR(((sC:\CODE\Sabel\Widget\ipython.pyR%s cCs�tt|�j|�|t_|t_t|_t|_d|_ |j
�|j �g|_ d|_ i|_t�}|jtjtddd��|jtjtddd��|j|�|jtdd��|jt��dS(Nti����ii�tCourieri (RRRtsyststdouttstderrtFalset refreshMarkert multiLineRt printBannertmarkerthistoryt historyIndextinterpreterLocalstQPalettetsetColortBasetQColortTextt
setPalettetsetFonttQFontRR (RRtpalette((sC:\CODE\Sabel\Widget\ipython.pyR.s"     

     cCsX|jtj�|jdtjd�|jdtd�d}|j|d�dS(Ns on s
sPyQt4 s?Type !hist for a history view and !hist(n) history index recall(twriteR"tversiontplatformtPYQT_VERSION_STR(Rtmsg((sC:\CODE\Sabel\Widget\ipython.pyR(Gs
cCs*|jr|jd�n |jd�dS(Ns... s>>> (R'tinsertPlainText(R((sC:\CODE\Sabel\Widget\ipython.pyR)Os cCsW|r5|djj}|jd�}||j|<n ||_|j|j�|_dS(NR(t __class__RtpopR,Rt interpreter(RR,tselfNametinterpreterLocalVars((sC:\CODE\Sabel\Widget\ipython.pyRUs  cCs|jj}||j|<dS(N(R<RR,(Rt newLocalst className((sC:\CODE\Sabel\Widget\ipython.pytupdateInterpreterLocalsas cCs|j|�|j�dS(N(R;tensureCursorVisible(Rtline((sC:\CODE\Sabel\Widget\ipython.pyR6es cCs_t|j�j�j�d�}|dkr2dSgt|�D]}|j�j�^q?tS(Nii( tlentdocumentt lastBlockttexttNonetxranget
textCursortdeletePreviousChartTrue(Rtlengthtx((sC:\CODE\Sabel\Widget\ipython.pytclearCurrentBlockis
" )cCs7|j�|jdkr3|j|j|j�ntS(Ni����(RQR+R;R*RN(R((sC:\CODE\Sabel\Widget\ipython.pyt recallHistoryss
c
Csi|dkr�|jd�|jj�}|j}|j�xut|�D]g\}}tt|��}ttt|���|}d|d||fd}}|j|�qIW|j |�|j
�t St j d|�re|jj�}|j}|j�t|dd!�} |j�|| }|dd krGt |_n|j|�|j |�t StS(
Ns!histR t s%i: %ss
s !hist\(\d+\)ii����t:(tappendR,tcopyR*treverset enumerateRFtstrR6RCR)RNtretmatchtintRQR'R%(
RRtbackupR*tiRPtiSizetdeltaREtindex((sC:\CODE\Sabel\Widget\ipython.pytcustomCommandszs4  

  




   cCs|j�tjkr(|jjd�n|j�tjkr�|jt|j�krg|jd8_ny9|jdkr�|jd8_|j �n
|j
�WnnXdS|j�tj kryNt|j�d|jkr�|jd7_|j �nt|j�|_WnnXdS|j�tj kr�t|j�j�j�d�}t|j�j��}||}|j�}|j|�|j|�dS|j�tjtjgkr�|j�j�dkr�dSn|j�tjtjgkr�|j�}t|j�j��}|j|�|j|�t|j�j�j��d}|j�d|_|j|�r�dSyD|dt|_|ddkr�t|_n|jj d|�Wnt!|_nX|jr|jr|j"|d7_"|j#d�|j$�dS|jrm|j rm||_"|j#d�|jj|j"�d|_"|j$�dS|jr�|j r�|j#d�|jj|j"�d|_"t!|_|j$�dS|j r�|j r�|j#d�|j$�dSdSnt%t&|�j'|�dS( Nsexit()ii����iRTis
R ((tkeytQtt
Key_EscapeR>RtKey_DownR+RFR*RRRQRJtKey_UptKey_HomeRGRHRIt toPlainTextRLt setPositiont setTextCursortKey_Leftt Key_BackspacetpositionInBlockt
Key_Returnt Key_EnterRYtrstripRbRNthaveLineR'tinsertR%RRUR)RRt keyPressEvent(Rteventt blockLengtht
lineLengthtpositionRLRE((sC:\CODE\Sabel\Widget\ipython.pyRt�s�  "
      "
     
   
   
 
N(RRRRRR(R)RJRRCR6RQRRRbRt(((sC:\CODE\Sabel\Widget\ipython.pyR#s     
 !t__main__(tosRZR"Rt PyQt4.QtGuit PyQt4.QtCoretQWidgetRt QTextEditRRt QApplicationtargvtappRJtwintshowtexittexec_(((sC:\CODE\Sabel\Widget\ipython.pyt<module>s    

�