diff options
author | Barry Warsaw <barry@python.org> | 1998-10-06 15:21:04 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-10-06 15:21:04 (GMT) |
commit | 14e2cafe21eebd5f6c40c9c0a542ae14a4f21296 (patch) | |
tree | 677a53e4b837b4fd976230c78ff826abb88e25c4 /Tools/pynche | |
parent | 7c51a9a80b8a39f9b119af880bb36b14aeec5d98 (diff) | |
download | cpython-14e2cafe21eebd5f6c40c9c0a542ae14a4f21296.zip cpython-14e2cafe21eebd5f6c40c9c0a542ae14a4f21296.tar.gz cpython-14e2cafe21eebd5f6c40c9c0a542ae14a4f21296.tar.bz2 |
usage(): Print msg at end of docstring
main(): Fixed logic error and reporting when no colordb was found.
Given by GvR.
Diffstat (limited to 'Tools/pynche')
-rw-r--r-- | Tools/pynche/Main.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Tools/pynche/Main.py b/Tools/pynche/Main.py index 403f8b1..700d2f9 100644 --- a/Tools/pynche/Main.py +++ b/Tools/pynche/Main.py @@ -55,9 +55,9 @@ RGB_TXT = [ def usage(status, msg=''): + print __doc__ % globals() if msg: print msg - print __doc__ % globals() sys.exit(status) @@ -88,11 +88,12 @@ def main(): for f in RGB_TXT: try: colordb = ColorDB.get_colordb(f) - break + if colordb: + break except IOError: pass else: - raise IOError('No color database file found') + usage(1, 'No color database file found, see the -d option.') # get triplet for initial color try: |