Error and warning messages

This commit is contained in:
Ian Jauslin 2024-02-21 17:01:52 -05:00
parent 5384d9a964
commit 37f8d181c2
2 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,10 @@ def read_cli():
# lattice # lattice
if c=='L': if c=='L':
flag="lattice" flag="lattice"
else:
print("error: unrecognized option '"+c+"'\n", file=sys.stderr)
exit()
else: else:
# read lattice argument # read lattice argument

View File

@ -533,6 +533,8 @@ class Painter(Widget):
self.set_color((float(color_str[0]),float(color_str[1]),float(color_str[2]))) self.set_color((float(color_str[0]),float(color_str[1]),float(color_str[2])))
except: except:
print("warning: ignoring line "+str(i)+" in file '"+file+"': color '"+color_str+"' cannot be read",file=sys.stderr) print("warning: ignoring line "+str(i)+" in file '"+file+"': color '"+color_str+"' cannot be read",file=sys.stderr)
else:
print("warning: ignoring line "+str(i)+" in file '"+file+"': unrecognized option '"+key+"'",file=sys.stderr)
continue continue
entries=line.split(";") entries=line.split(";")