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 = [ ...@@ -55,9 +55,9 @@ RGB_TXT = [
def usage(status, msg=''): def usage(status, msg=''):
print __doc__ % globals()
if msg: if msg:
print msg print msg
print __doc__ % globals()
sys.exit(status) sys.exit(status)
...@@ -88,11 +88,12 @@ def main(): ...@@ -88,11 +88,12 @@ def main():
for f in RGB_TXT: for f in RGB_TXT:
try: try:
colordb = ColorDB.get_colordb(f) colordb = ColorDB.get_colordb(f)
break if colordb:
break
except IOError: except IOError:
pass pass
else: else:
raise IOError('No color database file found') usage(1, 'No color database file found, see the -d option.')
# get triplet for initial color # get triplet for initial color
try: 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