Your IP : 216.73.216.213
B
� f � @ s� d Z dZddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddl m Z ddl
m
Z
ejd Zd Z
d
Zddej�ejd d
�gZdd� Zddd�Zdd� Zddd�Zdd� Zdd� Zedkr�e� dS )a 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
z1.4.1� N)�PyncheWidget)�Switchboard)�StripViewer)�
ChipViewer)�TypeinViewerzBarry Warsawzbarry@python.orgz/usr/openwin/lib/rgb.txtz/usr/lib/X11/rgb.txtz X/rgb.txtc C s
t t� S )N)�__doc__�globals� r r �6/opt/alt/python37/lib64/python3.7/Tools/pynche/Main.py� docstringS s r � c C s$ t t� � |rt |� t�| � d S )N)�printr �sys�exit)�code�msgr r r
�usageW s
r c C sp |fdd�}|| �\}}}|d kr4|d| �\}}}|d krTt d| � |d�\}}}|d krftdd� |||fS )Nc S sb y|� | �\}}}W nB tjk
rV yt�| �\}}}W n tjk
rP dS X Y nX |||fS )N)NNN)Zfind_byname�ColorDBZBadColorZrrggbb_to_triplet)�s�colordb�r�g�br r r
�
scan_colora s z!initial_color.<locals>.scan_color�#z Bad initial color, using gray50:Zgray50� z#Cannot find an initial color to use)r
r )r r r r r r r r r
�
initial_color_ s
r c C sv t | o
|�}|d kr$|�� �d�}d }td d � }|d krD|�� }xL|d kr�yt�|�}W n ttfk
rt Y nX |d krF|s�P |�d�}qFW |s�t dd� |�
|� tt|| d�}|�
� } |�t|| �� |�t|| �� |�t|| �� |d k�rP|�� }
|
�d�}|
�d�}|
�d�}
|d k�s>|
d k�s>|d k�r`td |�\}}}
nt||�\}}}
|�|||
� ||fS )
NZDBFILEr r z0No color database file found, see the -d option.)�masterZREDZGREENZBLUEZgrey50)r �optiondb�get�RGB_TXT�popr Zget_colordb�KeyError�IOErrorr Zset_colordbr �__version__ZwindowZadd_viewr r r r Zupdate_views)r �initialcolor�initfile�ignore�dbfiler r �files�app�wr ZredZgreenZbluer r r
�build{ sD
r, c C s&