
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
ó
¿œ^c           @   s˜   d  Z  d d l Z d d l Z d d l Td d l Z d d l Z d d l Z d Z d d d „  ƒ  YZ d d d „  ƒ  YZ	 d	 d d
 „  ƒ  YZ
 d „  Z d S(   s´   Main Pynche (Pythonically Natural Color and Hue Editor) widget.

This window provides the basic decorations, primarily including the menubar.
It is used to bring up other windows.
iÿÿÿÿN(   t   *iô  t   PyncheWidgetc           B   s˜   e  Z d g  d  „ Z d d „ Z d d „ Z d d „ Z d d „ Z d „  Z d „  Z	 d „  Z
 d d „ Z d d	 „ Z d d
 „ Z d „  Z d „  Z RS(   c         C   s¥  | |  _  | |  _ d  |  _ d  |  _ d  |  _ d  |  _ i  |  _ | } |  _ | r„ t	 | d d ƒ|  _
 } | j ƒ  | j ƒ  nd d  } y! d d l m } | } |  _
 Wn t k
 r¾ n X| sÞ t d d ƒ } |  _
 n  | j ƒ  t | ƒ } |  _ t | d d ƒ}	 |  _ |	 j d d	 d
 |  j d d ƒ | sa|	 j d d d
 |  j d d d d ƒ n  t |  j  |  j
 | ƒ }
 t | d d ƒ} x9 |
 D]1 } | j d | j ƒ  d
 | j d | j ƒ  ƒ q’Wt | d d d d ƒ} | j d d d
 |  j d d ƒ | j d d d
 |  j d d ƒ | j d d d |	 d d ƒ | j d d d | d d ƒ | j d d d | d d ƒ t	 | d d d | ƒ} |  _ | j d | r¨|  j  p®|  j ƒ | j! d | ƒ | j" d ƒ | sÿ| j# d |  j ƒ | j# d |  j ƒ n¢ t$ | d d d t% ƒ} | j& d d d  d d! d" d# d$ d% d& ƒ t' | d' d( d
 |  j( ƒ} | j) d) t* d* d ƒ t' | d' d+ d
 |  j+ ƒ} | j) d) t* d* d ƒ d  S(,   Nt   class_t   Pyncheiÿÿÿÿ(   t   _default_roott	   classNamet   tearoffi    t   labels   Load palette...t   commandt	   underlinet   Quitt   accelerators   Alt-Qt   namet   helps   About Pynche...s   Help...t   Filet   menut   Viewt   Helpt   WM_DELETE_WINDOWs	   Pynche %ss   <Alt-q>s   <Alt-Q>t   borderwidthi   t   relieft   rowi   t   columnt
   columnspani   t   stickyt   EWt   ipadyi   t   textt   Okayt   sidet   expandt   Cancel(,   t   _PyncheWidget__sbt   _PyncheWidget__versiont   Nonet   _PyncheWidget__textwint   _PyncheWidget__listwint   _PyncheWidget__detailswint   _PyncheWidget__helpwint   _PyncheWidget__dialogstatet   _PyncheWidget__modalt   Toplevelt   _PyncheWidget__tkroott   grab_sett   withdrawt   TkinterR   t   ImportErrort   Tkt   Menut   _PyncheWidget__menubart   _PyncheWidget__filemenut   add_commandt   _PyncheWidget__loadt   _PyncheWidget__quitt   make_view_popupst   menutextt   popupR	   t   _PyncheWidget__popup_aboutt   _PyncheWidget__popup_usaget   add_cascadet   _PyncheWidget__roott   protocolt   _PyncheWidget__bellt   titlet   iconnamet   bindt   Framet   RAISEDt   gridt   Buttont   _PyncheWidget__okayt   packt   LEFTt   _PyncheWidget__cancel(   t   selft   versiont   switchboardt   mastert	   extrapatht   modalt   tkrootR   t   menubart   filemenut   viewst   viewmenut   vt   helpmenut   roott   bframet   okayt   cancel(    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __init__   s’    							

		
						c         C   s   |  j  j ƒ  d  S(   N(   R*   t   quit(   RJ   t   event(    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __quit{   s    c         C   s   |  j  j ƒ  d  S(   N(   R*   t   bell(   RJ   R]   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __bell~   s    c         C   s(   |  j  j ƒ  |  j j ƒ  |  j ƒ  d  S(   N(   R    t   withdraw_viewsR*   t   grab_releaseR5   (   RJ   R]   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __okay�   s    c         C   s   |  j  j ƒ  |  j ƒ  d  S(   N(   R    t   canceledRF   (   RJ   R]   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __cancel†   s    c         C   s   |  j  j j t |  j ƒ d  S(   N(   R*   t   tkt   createtimerhandlert   KEEPALIVE_TIMERt   _PyncheWidget__keepalive(   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __keepaliveŠ   s    c         C   s'   |  j  s |  j ƒ  n  |  j j ƒ  d  S(   N(   R(   Ri   R*   t   mainloop(   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   start�   s    	c         C   s   |  j  S(   N(   R<   (   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   window”   s    c         C   s,   d d l  m } t j d | d | ƒ d  S(   Niÿÿÿÿ(   t   __version__s   About Pynche s}   Pynche %s
The PYthonically Natural
Color and Hue Editor

For information
contact: Barry A. Warsaw
email:   bwarsaw@python.org(   t   MainRn   t   tkMessageBoxt   showinfo(   RJ   R]   Rn   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __popup_about—   s    c         C   s5   |  j  s$ t |  j |  j ƒ |  _  n  |  j  j ƒ  d  S(   N(   R&   t   HelpwinR<   R5   t	   deiconify(   RJ   R]   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __popup_usage£   s    	c         C   sÕ   x¾ t  j j |  j j ƒ  j ƒ  ƒ \ } } t j d d d g d | d | ƒ } | sX d  Sy t j	 | ƒ } Wn( t
 k
 r• t j d d	 | ƒ q n X| d  k r¼ t j d
 d | ƒ q n  Pq W|  j j | ƒ d  S(   Nt	   filetypess
   Text filess   *.txts	   All filesR    t
   initialdirt   initialfiles
   Read errors#   Could not open file for reading:
%ss   Unrecognized color file types(   Unrecognized color file type in file:
%s(   s
   Text filess   *.txt(   s	   All filesR    (   t   ost   patht   splitR    t   colordbt   filenamet   tkFileDialogt   askopenfilenamet   ColorDBt   get_colordbt   IOErrorRp   t	   showerrorR"   t   set_colordb(   RJ   R]   t   idirt   ifilet   fileR|   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __load¨   s*    '					c         C   s   |  j  j ƒ  d  S(   N(   R<   R,   (   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR,   Ã   s    c         C   s   |  j  j ƒ  d  S(   N(   R<   Rt   (   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyRt   Æ   s    N(   t   __name__t
   __module__R"   R[   R5   R>   RF   RI   Ri   Rl   Rm   R9   R:   R4   R,   Rt   (    (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR      s   g				Rs   c           B   s&   e  Z d  „  Z d d „ Z d „  Z RS(   c         C   sú  d d l  m } t | d d ƒ|  _ } | j d |  j ƒ | j d ƒ | j d ƒ | j d | ƒ | j d | ƒ | j d	 |  j ƒ | j d
 |  j ƒ t	 j
 j t j
 d d ƒ } yk d  } zJ t | ƒ } | j ƒ  } | j d ƒ } | d k r
| |  j ƒ  } n  Wd  | r!| j ƒ  n  XWn* t k
 rOt j j d ƒ | ƒ  } n Xt | d t d d d d ƒ|  _ }	 |  j j ƒ  |	 j d | ƒ t | ƒ }
 |
 j d t d t ƒ |	 j d t d t  ƒ |	 j! d |
 d f ƒ |
 j! d |	 d f ƒ d  S(   Niÿÿÿÿ(   t	   docstringR   R   R   s   Pynche Help Windows   <Alt-q>s   <Alt-Q>s   <Alt-w>s   <Alt-W>i    t   READMEs   s8   Couldn't open Pynche's README, using docstring instead.
R   t   widthiP   t   heighti   g        t   fillR   R   t   yscrollcommandt   setR   t   yview("   Ro   R‹   R)   t   _Helpwin__rootR=   t   _Helpwin__withdrawR?   R@   RA   Ry   Rz   t   joint   sysR"   t   opent   readt   rfindt   rstript   closeR‚   t   stderrt   writet   Textt   SUNKENt   _Helpwin__textt	   focus_sett   insertt	   ScrollbarRG   t   Yt   RIGHTt   BOTHt   YESt	   configure(   RJ   RM   t   quitfuncR‹   RW   t
   readmefilet   fpt   contentst   iR   t	   scrollbar(    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR[   Ì   s@    c         C   s   |  j  j ƒ  d  S(   N(   R“   R,   (   RJ   R]   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt
   __withdrawô   s    c         C   s   |  j  j ƒ  d  S(   N(   R“   Rt   (   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyRt   ÷   s    N(   R‰   RŠ   R[   R"   R”   Rt   (    (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyRs   Ë   s   	(t   PopupViewerc           B   s8   e  Z d  „  Z d „  Z d „  Z d d „ Z d „  Z RS(   c         C   sˆ   | |  _  | |  _ | |  _ | |  _ | j |  _ | j j d ƒ } | d k rW d } n | j j d d d ƒ |  _ | |  _ d  |  _
 d  S(   Nt   %iÿÿÿÿi    t    i   (   t   _PopupViewer__mt   _PopupViewer__namet   _PopupViewer__sbt   _PopupViewer__roott	   ADDTOVIEWt   _PopupViewer__menutextt   findt   replacet   _PopupViewer__underlineR"   t   _PopupViewer__window(   RJ   t   moduleR   RL   RW   R	   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR[   ý   s    						c         C   s   |  j  S(   N(   R¸   (   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR7     s    c         C   s   |  j  S(   N(   R»   (   RJ   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR	     s    c         C   s]   |  j  sL t |  j |  j ƒ } | |  j |  j ƒ |  _  |  j j |  j  ƒ n  |  j  j ƒ  d  S(   N(   R¼   t   getattrR³   R´   Rµ   R¶   t   add_viewRt   (   RJ   R]   R   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR8     s
    	c         C   s   t  |  j | j ƒ S(   N(   t   cmpR¸   (   RJ   t   other(    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   __cmp__  s    N(   R‰   RŠ   R[   R7   R	   R"   R8   RÂ   (    (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR°   ü   s
   			c         C   s
  g  } t  j j t ƒ g | } xÚ | D]Ò } | d k rA d } n  x´ t  j | ƒ D]£ } | d d k rQ | d  } y t | ƒ } Wn0 t k
 r³ t d | ƒ }	 t |	 | ƒ } n Xt | d ƒ rô | j	 rô t
 | | |  | ƒ }
 | j |
 ƒ qô qQ qQ Wq& W| j ƒ  | S(   NR²   t   .i÷ÿÿÿs	   Viewer.pyiýÿÿÿs   pynche.R·   (   Ry   Rz   t   dirnamet   __file__t   listdirt
   __import__R.   R¾   t   hasattrR·   R°   t   appendt   sort(   RL   RW   RN   t   viewerst   dirst   dirR‡   R   R½   t   pkgRU   (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyR6     s$    	

(    (    (    (   t   __doc__R–   Ry   R-   Rp   R~   R€   Rh   R   Rs   R°   R6   (    (    (    s9   /usr/lib64/python2.7/site-packages/pynche/PyncheWidget.pyt   <module>   s   
¸1"