Your IP : 216.73.216.213
�
��f 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 d � Z d d d � Z d d � Z d d d d d d d � Z d d � Z d d � Z e d k r:e � n d S( u 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
u 1.4.1i N( u PyncheWidget( u Switchboard( u StripViewer( u
ChipViewer( u TypeinVieweru Barry Warsawu barry@python.orgu /usr/openwin/lib/rgb.txtu /usr/lib/X11/rgb.txtu X/rgb.txtc C s t t � S( N( u __doc__u globals( ( ( u6 /opt/alt/python33/lib64/python3.3/Tools/pynche/Main.pyu docstringS s u docstringu c C s1 t t � � | r t | � n t j | � d S( N( u printu docstringu sysu exit( u codeu msg( ( u6 /opt/alt/python33/lib64/python3.3/Tools/pynche/Main.pyu usageW s
u usagec C s� | d d � } | | � \ } } } | d k rL | d | � \ } } } n | d k r} t d | � | d � \ } } } n | d k r� t d d � n | | | f S( Nc S sy y | j | � \ } } } WnM t j k
rk y t j | � \ } } } Wn t j k
rf d SYn XYn X| | | f S( N( NNN( u find_bynameu ColorDBu BadColoru rrggbb_to_tripletu None( u su colordbu ru gu b( ( u6 /opt/alt/python33/lib64/python3.3/Tools/pynche/Main.pyu
scan_colora s u! initial_color.<locals>.scan_coloru #u Bad initial color, using gray50:u gray50i u# Cannot find an initial color to use( u Noneu printu usage( u su colordbu
scan_coloru ru gu b( ( u6 /opt/alt/python33/lib64/python3.3/Tools/pynche/Main.pyu
initial_color_ s
u
initial_colorc
C s t | o
| � } | d k r7 | j � j d � } n d } t d d � } | d k rh | j � } n xf | d k r� y t j | � } Wn t t f k
r� Yn X| d k rk | s� Pn | j d � } qk qk 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(
Nu DBFILEi i u0 No color database file found, see the -d option.u masteru REDu GREENu BLUEu grey50( u Switchboardu Noneu optiondbu getu RGB_TXTu popu ColorDBu get_colordbu KeyErroru IOErroru usageu set_colordbu PyncheWidgetu __version__u windowu add_viewu StripVieweru
ChipVieweru TypeinVieweru
initial_coloru update_views( u masteru initialcoloru initfileu ignoreu dbfileu su colordbu filesu appu wu optiondbu redu greenu blue( ( u6 /opt/alt/python33/lib64/python3.3/Tools/pynche/Main.pyu build{ sD
$u buildc C s'