ó ¿œ^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&