Commit 2d9b8346 authored by Barry Warsaw's avatar Barry Warsaw

usage(): Print msg at end of docstring

main(): Fixed logic error and reporting when no colordb was found.
Given by GvR.
parent a2d5310b
......@@ -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)
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment