509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
ó
wWS`c           @   s‚  d  d l  Z  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Td  d l Z d  d l	 Z	 d  d l
 m
 Z
 d  d l m Z y# d  d l Z e j e j d ƒ Wn e e j f k
 rÙ n Xe j ƒ  Z d Z e j d k r3y! e j ƒ  d	 Z e  j e ƒ Wn e k
 r/n Xn½ yD e j e j ƒ Z e e k p]e d k rid Z n  e  j e ƒ Wnv e e e f k
 rïyB e j ƒ  d	 Z e e k p¸e d k rÄd Z n  e  j e ƒ Wn e e f k
 rën Xn Xe j ƒ  Z e j  d
 ƒ Z! e j  d ƒ Z" d e
 f d „  ƒ  YZ# d „  Z$ d f  d „  ƒ  YZ% d „  Z& e' d k r~d  d l( m) Z) e) e& ƒ n  d S(   iÿÿÿÿN(   t   BOM_UTF8(   t   *(   t   SimpleDialog(   t   idleConft    t   asciit   win32i   s&   ^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s   ^[ \t\f]*(?:[#\r\n]|$)t   EncodingMessagec           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s3   Inform user that an encoding declaration is needed.c   
      C   sÅ  t  |  _ t | ƒ |  _ } | j d |  j ƒ | j d |  j ƒ | j d |  j ƒ | j	 d ƒ | j
 d ƒ | |  _ t | d d ƒ} | j d t d t ƒ t | d	 d
 ƒ} | j d d | ƒ | j d t d t d t ƒ t | d d | ƒ} | j d t d t ƒ t | ƒ } | j d t d t ƒ d |  _ |  _ t | d d d d d |  j ƒ} | j d t d t d d ƒ t | d d d |  j ƒ}	 |	 j d t d t d d ƒ |  j | ƒ d  S(   Ns   <Return>s   <Escape>t   WM_DELETE_WINDOWs   I/O Warningt   texts:   Non-ASCII found, yet no encoding declared. Add a line liket   sidet   anchort   fontt   courieri    s   # -*- coding: %s -*-t   fills•   to your file
See Language Reference, 2.1.4 Encoding declarations.
Choose OK to save this file as %s
Edit your general options to silence this warningt   Okt   defaultt   activet   commandt   expandi   s   Edit my file(   t   Falset   should_editt   Toplevelt   roott   bindt   return_eventt   do_okt   protocolt   wm_delete_windowt   wm_titlet   wm_iconnamet   topt   Labelt   packt   TOPt   Wt   Entryt   insertt   Xt   FrameR   t   cancelt   Buttont   LEFTt   BOTHt   do_editt   _set_transient(
   t   selft   mastert   encR   t   l1t   l2t   l3t   buttonst   b1t   b2(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   __init__J   s6    				
c         C   s   |  j  d ƒ d  S(   Ni    (   t   done(   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR   q   s    c         C   s   |  j  d ƒ d  S(   Ni   (   R8   (   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR,   t   s    (   t   __name__t
   __module__t   __doc__R7   R   R,   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR   H   s   	'	c         C   s®   |  j  d d ƒ d  } xD | D]8 } t j | ƒ } | d k	 rB Pn  t j | ƒ s d Sq Wd S| j d ƒ } d d l } y | j | ƒ Wn t k
 r© t d | ‚ n X| S(   sz   Return the encoding declaration according to PEP 263.

    Raise LookupError if the encoding is declared but unknown.
    s   
i   i   iÿÿÿÿNs   Unknown encoding (	   t   splitt	   coding_ret   matcht   Nonet   blank_ret   groupt   codecst   lookupt   LookupError(   t   strt   lstt   lineR>   t   nameRB   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   coding_specw   s    t	   IOBindingc           B   s=  e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d" Z d „  Z	 d" Z
 d" Z d „  Z d" d" d „ Z d Z e j e ƒ Z e j Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d" Z d" Z  d# d$ d% g Z! e" j# d k rd n d Z$ d „  Z% d d „ Z& d  „  Z' d! „  Z( RS(&   c         C   s©   | |  _  | j |  _ |  j j d |  j ƒ |  _ |  j j d |  j ƒ |  _ |  j j d |  j ƒ |  _ |  j j d |  j	 ƒ |  _
 d  |  _ |  j j d |  j ƒ |  _ d  S(   Ns   <<open-window-from-file>>s   <<save-window>>s   <<save-window-as-file>>s   <<save-copy-of-window-as-file>>s   <<print-window>>(   t   editwinR	   R   t   opent   _IOBinding__id_opent   savet   _IOBinding__id_savet   save_ast   _IOBinding__id_saveast   save_a_copyt   _IOBinding__id_savecopyR?   t   fileencodingt   print_windowt   _IOBinding__id_print(   R.   RK   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR7   ’   s    		c         C   s�   |  j  j d |  j ƒ |  j  j d |  j ƒ |  j  j d |  j ƒ |  j  j d |  j ƒ |  j  j d |  j ƒ d  |  _ d  |  _  d  |  _	 d  S(   Ns   <<open-window-from-file>>s   <<save-window>>s   <<save-window-as-file>>s   <<save-copy-of-window-as-file>>s   <<print-window>>(
   R	   t   unbindRM   RO   RQ   RS   RV   R?   RK   t   filename_change_hook(   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   closež   s    		c         C   s   |  j  j ƒ  S(   N(   RK   t	   get_saved(   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRZ   ª   s    c         C   s   |  j  j | ƒ d  S(   N(   RK   t	   set_saved(   R.   t   flag(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR[   ­   s    c         C   s   |  j  j ƒ  d  S(   N(   RK   t
   reset_undo(   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR]   °   s    c         C   s   | |  _  d  S(   N(   RX   (   R.   t   hook(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   set_filename_change_hookµ   s    c         C   sf   | r- t  j j | ƒ r- d  |  _ | |  _ n5 | |  _ d  |  _ |  j d ƒ |  j rb |  j ƒ  n  d  S(   Ni   (   t   ost   patht   isdirR?   t   filenamet   dirnameR[   RX   (   R.   Rc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   set_filename»   s    				c         C   s%  |  j  j } | r« | s' |  j ƒ  } n | } | rŽ |  j  r~ t |  j  d d  ƒ r~ |  j r~ |  j ƒ  r~ | j | |  j ƒ q§ | j | ƒ n |  j	 r§ |  j	 j
 ƒ  n  d S|  j ƒ  rã |  j ƒ  } | d k rã |  j	 j
 ƒ  d Sn  | sø |  j ƒ  } n | } | r|  j | ƒ n |  j	 j
 ƒ  d S(   Nt   interpt   breakR(   (   RK   t   flistt   askopenfilet   getattrR?   Rc   RZ   RL   t   loadfileR	   t	   focus_sett	   maybesave(   R.   t   eventt   editFileRh   Rc   t   reply(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRL   Æ   s6    	
	s   (\r\n)|\n|\rc         C   sW  y( t  | d ƒ � } | j ƒ  } Wd  QXWn3 t k
 r] } t j d t | ƒ d |  j ƒt SX|  j | ƒ } |  j	 j
 | ƒ } | rÙ | j d ƒ |  _ t |  j t ƒ rÁ |  j j d ƒ |  _ n  |  j	 j d | ƒ } n  |  j j d d ƒ |  j d  ƒ |  j j d | ƒ |  j ƒ  |  j | ƒ |  j j d	 d ƒ |  j j d	 ƒ |  j | ƒ t S(
   Nt   rbs	   I/O Errort   parenti    R   s   \ns   1.0t   endR%   (   RL   t   readt   IOErrort   tkMessageBoxt	   showerrorRE   R	   R   t   decodet   eol_ret   searchRA   t   eol_conventiont
   isinstancet   unicodet   encodet   subt   deleteRe   R?   R%   R]   t   mark_sett   yviewt   updaterecentfileslistt   True(   R.   Rc   t   ft   charst   msgt   firsteol(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRk   ö   s,    
c         C   s!  | j  t ƒ rK y | d j d ƒ } Wn t k
 r: | SXt |  _ | Sn  y t | ƒ } Wn< t k
 r™ } t j d d d d | d |  j	 ƒ d	 } n X| rÈ y t | | ƒ SWqÈ t k
 rÄ qÈ Xn  y t | d ƒ SWn t k
 rì n Xy t | t ƒ } t |  _ Wn t k
 rn X| S(
   sM   Create a Unicode string

        If that fails, let Tcl try its best
        i   s   utf-8t   titles   Error loading the filet   messages^   The encoding '%s' is not known to this Python installation. The file may not display correctlyRr   R   N(   t
   startswithR    Rx   t   UnicodeErrorRT   RI   RD   Rv   Rw   R	   R?   R}   t   encoding(   R.   R†   R0   RH   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRx     s>    		

c      	   C   sª   |  j  ƒ  r d Sd |  j p d } t j d d d | d t j d |  j ƒ } | r~ d } |  j d  ƒ |  j  ƒ  s™ d	 } q™ n | d  k r“ d	 } n d
 } |  j j ƒ  | S(   Nt   yess&   Do you want to save %s before closing?s   this untitled documentR‰   s   Save On CloseRŠ   R   Rr   R(   t   no(	   RZ   Rc   Rv   t   askyesnocancelt   YESR	   RN   R?   Rl   (   R.   RŠ   t   confirmRp   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRm   A  s&    			c         C   sq   |  j  s |  j | ƒ nG |  j |  j  ƒ r` |  j t ƒ y |  j j ƒ  Wq` t k
 r\ q` Xn  |  j j	 ƒ  d S(   NRg   (
   Rc   RP   t	   writefileR[   R„   RK   t   store_file_breakst   AttributeErrorR	   Rl   (   R.   Rn   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRN   W  s    	c         C   s„   |  j  ƒ  } | rf |  j | ƒ rf |  j | ƒ |  j d ƒ y |  j j ƒ  Wqc t k
 r_ qc Xqf n  |  j j ƒ  |  j	 | ƒ d S(   Ni   Rg   (
   t   asksavefileR“   Re   R[   RK   R”   R•   R	   Rl   Rƒ   (   R.   Rn   Rc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRP   d  s    
c         C   s@   |  j  ƒ  } | r" |  j | ƒ n  |  j j ƒ  |  j | ƒ d S(   NRg   (   R–   R“   R	   Rl   Rƒ   (   R.   Rn   Rc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRR   r  s    c         C   sÓ   |  j  ƒ  |  j |  j j d d ƒ ƒ } |  j d k rO | j d |  j ƒ } n  yJ t | d ƒ �1 } | j | ƒ | j ƒ  t	 j
 | j ƒ  ƒ Wd  QXt SWn3 t k
 rÎ } t j d t | ƒ d |  j ƒt SXd  S(   Ns   1.0s   end-1cs   
t   wbs	   I/O ErrorRr   (   t   fixlastlineR~   R	   t   getR{   t   replaceRL   t   writet   flushR`   t   fsynct   filenoR„   Ru   Rv   Rw   RE   R   (   R.   Rc   R†   R…   R‡   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR“   z  s    


c   
      C   s˜  t  | t ƒ r | Sy | j d ƒ SWn t k
 r7 n Xy t | ƒ } d  } Wn t k
 ro } | } d  } n X| r¨ y | j | ƒ SWq¨ t k
 r¤ d | } q¨ Xn  | rÎ t j d d | d |  j	 ƒn  |  j
 t k sã | rô t | j d ƒ S|  j
 rVy | j |  j
 ƒ SWqVt k
 rRt j d d |  j
 d |  j	 ƒt | j d ƒ SXn  t j d d	 d
 ƒ } | d k rˆt | j d ƒ St } y. | j t ƒ } t } | d k r»t } n  Wn* t k
 rèt | j d ƒ } d } n X| só| St |  j j | ƒ } | j ƒ  | j d k r”d | } |  j	 j d d ƒ }	 |	 j d ƒ re|  j	 j d | ƒ n |  j	 j d | ƒ |  j |  j	 j d d ƒ ƒ S| S(   NR   s   Invalid encoding '%s's	   I/O Errors   %s. Saving as UTF-8Rr   s   utf-8s1   Cannot save this as '%s' anymore. Saving as UTF-8t   maint   EditorWindowR�   t   localei   s   # -*- coding: %s -*-
s   1.0s   2.0s   #!s   end-1c(   R|   RE   R~   RŒ   RI   R?   RD   Rv   Rw   R	   RT   R    R   t	   GetOptionR„   R�   R   R   RK   R   t   got   numR™   R‹   R%   (
   R.   R†   R0   t   failedR‡   t   config_encodingt   ask_usert   dialogt   enclinet	   firstline(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR~   Š  sv    


	

	


c         C   s8   |  j  j d ƒ } | d k r4 |  j  j d d ƒ n  d  S(   Ns   end-2cs   
s   end-1c(   R	   R™   R%   (   R.   t   c(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR˜   Ô  s    c      	   C   s  t  j d d d d d t  j d |  j ƒ } | sA |  j j ƒ  d Sd  } |  j ƒ  } | re |  j } n  | sx | d  k rÆ t j	 d d	 ƒ \ } } | } t
 j | ƒ |  j | ƒ sÆ t
 j | ƒ d Sn  t
 j } t } | d
 k rt j d d d ƒ }	 |	 d }	 n* | d k r't j d d d ƒ }	 n t } | rÆ|	 t j | ƒ }	 t
 j |	 d ƒ }
 |
 j ƒ  j ƒ  } |
 j ƒ  } | r�d | | } n  | réd t |	 ƒ | } t  j d | d |  j ƒqén# d | } t  j d | d |  j ƒ| rÿt
 j | ƒ n  d S(   NR‰   t   PrintRŠ   s   Print to Default PrinterR   Rr   Rg   t   prefixt	   IDLE_tmp_t   posixRŸ   t   Generals   print-command-posixs    2>&1t   nts   print-command-wint   rs#   Printing failed (exit status 0x%x)
s   Printing command: %s
s   Print statuss-   Printing is not enabled for this platform: %s(   Rv   t   askokcancelt   OKR	   Rl   R?   RZ   Rc   t   tempfilet   mkstempR`   RY   R“   t   unlinkRH   R„   R   R¢   R   t   pipest   quotet   popenRt   t   stript   reprRw   t   showinfo(   R.   Rn   R’   t   tempfilenamet   savedRc   t   tfdt   platformt   printPlatformR   t   pipet   outputt   statusRŠ   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRU   Ù  sX    				
s   Python filess
   *.py *.pywt   TEXTs
   Text filess   *.txts	   All filesR   t   darwins   .pyR   c         C   s‚   |  j  d ƒ \ } } |  j sB t j d |  j d |  j ƒ |  _ n  |  j j d | d | ƒ } t | t ƒ r~ | j	 t
 ƒ } n  | S(   NRL   Rr   t	   filetypest
   initialdirt   initialfile(   t   defaultfilenamet
   opendialogt   tkFileDialogt   OpenR	   RÈ   t   showR|   R}   R~   t   filesystemencoding(   R.   t   dirt   baseRc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRi     s    	RL   c         C   sm   |  j  r t j j |  j  ƒ S|  j r2 |  j d f Sy t j ƒ  } Wn t j k
 r^ d } n X| d f Sd  S(   NR   (   Rc   R`   Ra   R<   Rd   t   getcwdt   error(   R.   t   modet   pwd(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRË      s    		
c         C   s‹   |  j  d ƒ \ } } |  j sK t j d |  j d |  j d |  j ƒ |  _ n  |  j j d | d | ƒ } t | t	 ƒ r‡ | j
 t ƒ } n  | S(   NRN   Rr   RÈ   t   defaultextensionRÉ   RÊ   (   RË   t
   savedialogRÍ   t   SaveAsR	   RÈ   R×   RÏ   R|   R}   R~   RÐ   (   R.   RÑ   RÒ   Rc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR–   ,  s    				c         C   s   |  j  j | ƒ d S(   s-   Update recent file list on all editor windowsN(   RK   t   update_recent_files_list(   R.   Rc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRƒ   8  s    N(   s   Python filess
   *.py *.pywRÆ   (   s
   Text filess   *.txtRÆ   (   s	   All filesR   ()   R9   R:   R7   RY   RZ   R[   R]   R?   RX   R_   Rc   Rd   Re   RL   t   eolt   ret   compileRy   R`   t   linesepR{   Rk   Rx   Rm   RN   RP   RR   R“   R~   R˜   RU   RÌ   RØ   RÈ   t   sysRÁ   R×   Ri   RË   R–   Rƒ   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRJ   �   sD   							,			-						J		2		
	c         C   sÊ   d d l  m } m } | |  ƒ } | j d ƒ t t t t j d |  j	 ƒ  ƒ ƒ ƒ \ } } } } | j	 d | | d f ƒ d d	 d „  ƒ  Y} | | ƒ }	 |	 j
 ƒ  |	 j ƒ  | |	 ƒ }
 t |
 ƒ d  S(
   Niÿÿÿÿ(   R   t   Texts   Test IOBindings   [x+]s   +%d+%di–   t	   MyEditWinc           B   sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         S   s„   | |  _  d  |  _ |  j  j d |  j ƒ |  j  j d |  j ƒ |  j  j d |  j ƒ |  j  j d |  j ƒ |  j  j d |  j ƒ d  S(   Ns   <Control-o>s   <Control-p>s   <Control-s>s   <Alt-s>s   <Control-c>(	   R	   R?   Rh   R   RL   t   printerRN   t   saveast   savecopy(   R.   R	   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR7   E  s    		c         S   s   d S(   Ni    (    (   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRZ   M  R   c         S   s   d  S(   N(    (   R.   R\   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR[   N  R   c         S   s   d  S(   N(    (   R.   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyR]   O  R   c         S   s   d  S(   N(    (   R.   Rc   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRÚ   P  R   c         S   s   |  j  j d ƒ d  S(   Ns   <<open-window-from-file>>(   R	   t   event_generate(   R.   Rn   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRL   Q  s    c         S   s   |  j  j d ƒ d  S(   Ns   <<print-window>>(   R	   Rå   (   R.   Rn   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRâ   S  s    c         S   s   |  j  j d ƒ d  S(   Ns   <<save-window>>(   R	   Rå   (   R.   Rn   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRN   U  s    c         S   s   |  j  j d ƒ d  S(   Ns   <<save-window-as-file>>(   R	   Rå   (   R.   Rn   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRã   W  s    c         S   s   |  j  j d ƒ d  S(   Ns   <<save-copy-of-window-as-file>>(   R	   Rå   (   R.   Rn   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRä   Y  s    (   R9   R:   R7   RZ   R[   R]   RÚ   RL   Râ   RN   Rã   Rä   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyRá   D  s   									(    (   t   TkinterR   Rà   R‰   t   listt   mapt   intRÜ   R<   t   geometryR!   Rl   RJ   (   Rr   R   Rà   R   t   widtht   heightt   xt   yRá   R	   RK   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   _io_binding=  s    3

t   __main__(   t   run(*   RB   R    R`   R¸   RÜ   Rß   Rµ   Ræ   RÍ   Rv   R   t   idlelib.configHandlerR   R¡   t	   setlocalet   LC_CTYPEt   ImportErrort   Errort   getfilesystemencodingRÐ   R�   RÁ   t   getdefaultlocaleRC   RD   t   nl_langinfot   CODESETR?   t	   NameErrorR•   t
   ValueErrort   lowerRÝ   R=   R@   R   RI   RJ   Rï   R9   t   idlelib.idle_test.htestRñ   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/IOBinding.pyt   <module>   s`   
		/	ÿ ®	%