???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
¿œ^c           @   s,  d  Z  d Z d d l Z d d l 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	 m	 Z	 d d l
 m
 Z
 e j d	 Z d
 Z d Z d d e j j e j d	 d ƒ g Z d „  Z d d „ Z d „  Z d d d d d d „ Z d „  Z d „  Z e d k r(e ƒ  n  d S(   s  Pynche -- The PYthon Natural Color and Hue Editor.

Contact: %(AUTHNAME)s
Email:   %(AUTHEMAIL)s
Version: %(__version__)s

Pynche is based largely on a similar color editor I wrote years ago for the
SunView window system.  That editor was called ICE: the Interactive Color
Editor.  I'd always wanted to port the editor to X but didn't feel like
hacking X and C code to do it.  Fast forward many years, to where Python +
Tkinter provides such a nice programming environment, with enough power, that
I finally buckled down and implemented it.  I changed the name because these
days, too many other systems have the acronym `ICE'.

This program currently requires Python 2.2 with Tkinter.

Usage: %(PROGRAM)s [-d file] [-i file] [-X] [-v] [-h] [initialcolor]

Where:
    --database file
    -d file
        Alternate location of a color database file

    --initfile file
    -i file
        Alternate location of the initialization file.  This file contains a
        persistent database of the current Pynche options and color.  This
        means that Pynche restores its option settings and current color when
        it restarts, using this file (unless the -X option is used).  The
        default is ~/.pynche

    --ignore
    -X
        Ignore the initialization file when starting up.  Pynche will still
        write the current option settings to this file when it quits.

    --version
    -v
        print the version number and exit

    --help
    -h
        print this message

    initialcolor
        initial color, as a color name or #RRGGBB format
s   1.4.1iÿÿÿÿN(   t   PyncheWidget(   t   Switchboard(   t   StripViewer(   t
   ChipViewer(   t   TypeinVieweri    s   Barry Warsaws   barry@python.orgs   /usr/openwin/lib/rgb.txts   /usr/lib/X11/rgb.txts	   X/rgb.txtc           C   s   t  t ƒ  S(   N(   t   __doc__t   globals(    (    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt	   docstringS   s    t    c         C   s'   t  ƒ  GH| r | GHn  t j |  ƒ d  S(   N(   R   t   syst   exit(   t   codet   msg(    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt   usageW   s    c         C   sŸ   | d „ } | |  ƒ \ } } } | d  k rI | d |  ƒ \ } } } n  | d  k rv d G|  GH| d ƒ \ } } } n  | d  k r’ t d d ƒ n  | | | f S(   Nc         S   st   y | j  |  ƒ \ } } } WnH t j k
 rf y t j |  ƒ \ } } } Wqg t j k
 rb d SXn X| | | f S(   N(   NNN(   t   find_bynamet   ColorDBt   BadColort   rrggbb_to_triplett   None(   t   st   colordbt   rt   gt   b(    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt
   scan_colora   s    	t   #s    Bad initial color, using gray50:t   gray50i   s#   Cannot find an initial color to use(   R   R   (   R   R   R   R   R   R   (    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt   initial_color_   s    	c         C   s	  t  | o | ƒ } | d  k r7 | j ƒ  j d ƒ } n  d  } t } | d  k r_ | j ƒ  } n  xe | d  k rÆ y t j | ƒ } Wn t t	 f k
 rš n X| d  k rb | s± Pn  | j d ƒ } qb qb W| sÝ t
 d d ƒ n  | j | ƒ t t | d |  ƒ} | j ƒ  }	 | j t | |	 ƒ ƒ | j t | |	 ƒ ƒ | j t | |	 ƒ ƒ | d  k rÔ| j ƒ  }
 |
 j d ƒ } |
 j d ƒ } |
 j d ƒ } | d  k s¶| d  k s¶| d  k rìt d	 | ƒ \ } } } qìn t | | ƒ \ } } } | j | | | ƒ | | f S(
   Nt   DBFILEi    i   s0   No color database file found, see the -d option.t   mastert   REDt   GREENt   BLUEt   grey50(   R   R   t   optiondbt   gett   RGB_TXTt   popR   t   get_colordbt   KeyErrort   IOErrorR   t   set_colordbR    t   __version__t   windowt   add_viewR   R   R   R   t   update_views(   R   t   initialcolort   initfilet   ignoret   dbfileR   R   t   filest   appt   wR"   t   redt   greent   blue(    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt   build{   sD    $c         C   s&   y |  j  ƒ  Wn t k
 r! n Xd  S(   N(   t   startt   KeyboardInterrupt(   R3   R   (    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt   run¯   s    c       	   C   s–  y5 t  j  t j d d d d d d d g ƒ \ }  } Wn# t  j k
 rZ } t d | ƒ n Xt | ƒ d k rv d  } n) t | ƒ d k r• | d } n
 t d ƒ t } d  } t j	 j
 d	 ƒ } x” |  D]Œ \ } } | d k ré t d ƒ qÄ | d k rd t ƒ  GHt j d ƒ qÄ | d k r&| } qÄ | d k r;t } qÄ | d k rÄ | } qÄ qÄ Wt d | d | d | d | ƒ \ }	 }
 t |	 |
 ƒ |
 j ƒ  d  S(   Ni   s   hd:i:Xvs	   database=s	   initfile=R0   t   helpt   versioni    s	   ~/.pynches   -hs   --helps   -vs	   --versionsx   Pynche -- The PYthon Natural Color and Hue Editor.
Contact: %(AUTHNAME)s
Email:   %(AUTHEMAIL)s
Version: %(__version__)ss   -ds
   --databases   -Xs   --ignores   -is
   --initfileR.   R/   R1   (   s   -hs   --help(   s   -vs	   --version(   s   -ds
   --database(   s   -Xs   --ignore(   s   -is
   --initfile(   t   getoptR	   t   argvt   errorR   t   lenR   t   Falset   ost   patht
   expanduserR   R
   t   TrueR8   R;   t
   save_views(   t   optst   argsR   R.   R0   R1   R/   t   optt   argR3   t   sb(    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt   main·   sB    
"	
		t   __main__(   R   R*   R	   RC   R>   R   R    R   R   R   R   R?   t   PROGRAMt   AUTHNAMEt	   AUTHEMAILRD   t   joinR$   R   R   R   R   R8   R;   RM   t   __name__(    (    (    s1   /usr/lib64/python2.7/site-packages/pynche/Main.pyt   <module>/   s2   		3		-