Edit File: CodeContext.pyo
� ��7ec�����������@���s����d��Z��d�d�l�Z�d�d�l�m�Z�m�Z�m�Z�m�Z�m�Z�d�d�l�Z�d�d�l �m �Z�d�d�l�m �Z �d�d�d�d �d �d�d�d �d�d�d�h�Z�d�Z�d�Z�e�j�d���d���Z�d�d�d�������YZ�d�S(���sI��CodeContext - Extension to display the block context above the edit window Once code has scrolled off the top of a window, it can be difficult to determine which block you are in. This extension implements a pane at the top of each IDLE edit window which provides block structure hints. These hints are the lines which contain the block opening keywords, e.g. 'if', for the enclosing block. The number of hint lines is determined by the numlines variable in the CodeContext section of config-extensions.def. Lines which do not open blocks are not shown in the context hints pane. i����N(���t���TOPt���LEFTt���Xt���Wt���SUNKEN(���t���maxint(���t���idleConft���classt���deft���elift���elset���exceptt���finallyt���fort���ift���tryt���whilet���withid���i���s���^(\s*)(\w*)c���������C���s���|�j��|����j����S(���N(���t���matcht���groups(���t���st���c(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyt���<lambda>���t����t���CodeContextc�����������B���s����e��Z�d��d�g�f�g�Z�e�j�d�d�d�d�d�d�d ��Z�e�j�d�d�d �d�d�d�d��Z�e�j�d�d�d �d�d�d�d��Z�d����Z�d�d���Z �d����Z�d�d�d���Z�d����Z �d����Z�d����Z�RS(���t���optionss���!Code Conte_xts���<<toggle-code-context>>t ���extensionsR���t���numlinest���typet���intt���defaulti���t���bgcolort���strt ���LightGrayt���fgcolort���Blackc���������C���s����|�|��_��|�j�|��_�|��j�d�|��_�d��|��_�d�d�d�t�f�g�|��_�d�|��_�t�j �d�d�d�d �d �d�t��}�|�r��|��j ����|��j��j�d�t���n��|��j�j �t�|��j���|��j�j �t�|��j���d��S( ���Nt���fonti����i����R���i���R���R���t���visibleR���t���boolR���s���<<toggle-code-context>>(���t���editwint���textt���textfontt���Nonet���labelt���Falset���infot ���topvisibleR���t ���GetOptiont���toggle_code_context_eventt���setvart���Truet���aftert���UPDATEINTERVALt���timer_eventt���FONTUPDATEINTERVALt���font_timer_event(���t���selfR'���R%���(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyt���__init__"���s���� c���������C���s���|��j��sC|��j�j�|��j�j�f�}�d�}�xM�|�D]E�}�|�t�t�|�j����d�����7}�|�t�t�|�j�d�������7}�q.�Wd�}�x-�|�D]%�}�|�t�t�|�j�d�������7}�q��Wt�j �|��j�j �d�d�|��j�d�d�t�d�t �d �|��j�d �|��j�d�|��j�d�d�d�|�d�|�d �t�� |��_��|��j��j�d�t�d�t�d�t�d�|��j�j���n�|��j��j����d��|��_��t�j�d�d�d�t�|��j��d��k �����t�j����d��S(���Ni����t���padxt���borderR(���s��� i���t���anchort���justifyR$���t���bgt���fgt���widtht���relieft���sidet���fillt���expandt���beforeR���R���R%���(���R+���R'���R(���t ���text_frameR���R ���t ���pack_infot���cgett���Tkintert���Labelt���topt ���context_depthR���R���R)���R���R"���R���t���packR����R���R,���t���destroyR*���R���t ���SetOptiont���SaveUserCfgFiles(���R8���t���eventt���widgetsR:���t���widgetR;���(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyR0���7���s0���� # # c���������C���s����|��j��j�d�|�d�|���}�t�|���\�}�}�|�t�k�o>�|�}�t�|���t�|���k�so�|�t�|���d�k�rx�t�}�n�t�|���}�|�|�|�f�S(���s����Get the line indent value, text, and any block start keyword If the line does not start a block, the keyword value is False. The indentation of empty lines (or comment lines) is INFINITY. s���%d.0s���%d.endt���#(���R(���t���gett���getspacesfirstwordt���BLOCKOPENERSt���lent���INFINITY(���R8���t���linenumR(���t���spacest ���firstwordt���openert���indent(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyt ���get_line_info[���s����. i���i����c��� ������C���s����g��}�t��}�x��t�|�|�d�d���D]��}�|��j�|���\�}�}�} �|�|�k��r#�|�}�| �d�k�rl�|�d�7}�n��| �r��|�|�k��r��|�|�k�r��|�j�|�|�|�| �f���n��|�|�k�r��Pq��q#�q#�W|�j����|�|�f�S(���s����Get context lines, starting at new_topvisible and working backwards. Stop when stopline or stopindent is reached. Return a tuple of context data and the indent level at the top of the region inspected. i���i����R ���R ���(���R ���R ���(���RY���t���xrangeR_���t���appendt���reverse( ���R8���t���new_topvisiblet���stoplinet ���stopindentt���linest ���lastindentRZ���R^���R(���R]���(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyt���get_contextk���s���� c���������C���s���t��|��j�j�d���j�d���d���}�|��j�|�k�r8�d�S|��j�|�k��r��|��j�|�|��j���\�}�}�x��|��j�d�d�|�k�r��|��j�d�=qe�Wn��|��j�|�k�r|��j�d�d�d�}�x6�|��j�d�d�|�k�r��|��j�d�d�}�|��j�d�=q��W|��j�|�|��j�d�d�d�|���\�}�}�n��|��j�j�|���|�|��_�d�g�t�d�|��j �t �|��j�����}�|�g��|��j�|��j �D]�}�|�d�^�qk7}�d �j�|���|��j�d �<d�S(���sK���Update context information and lines visible in the context pane. s���@0,0t���.i����Ni����i���R���i���s��� R(���( ���R���R(���t���indext���splitR.���Rh���R-���t���extendt���maxRL���RX���t���joinR+���(���R8���Rc���Rf���Rg���Re���t���context_stringst���x(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyt���update_code_context����s*����% &,c���������C���s0���|��j��r�|��j����n��|��j�j�t�|��j���d��S(���N(���R+���Rq���R(���R3���R4���R5���(���R8���(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyR5�������s���� c���������C���s[���|��j��d�}�|��j�rA�|�|��j�k�rA�|�|��_�|��j�|��j�d�<n��|��j��j�t�|��j���d��S(���NR$���(���R(���R+���R)���R3���R6���R7���(���R8���t���newtextfont(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyR7�������s ���� (���s���!Code Conte_xts���<<toggle-code-context>>N(���t���__name__t ���__module__t���menudefsR���R/���RL���R���R"���R9���R*���R0���R_���Rh���Rq���R5���R7���(����(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyR������s��� $ (����(���t���__doc__RI���t���TkconstantsR����R���R���R���R���t���ret���sysR���RY���t���idlelib.configHandlerR���RW���R4���R6���t���compileRV���R���(����(����(����s+���/usr/lib64/python2.7/idlelib/CodeContext.pyt���<module>���s���(