[r21492]grampletpane: Fix typo, naked except.

Warn with the reason when Dashboard file can't be opened or parsed.

svn: r21500
This commit is contained in:
John Ralls 2013-02-28 19:23:15 +00:00
parent d704d9ac4b
commit e8bad4d4c8

View File

@ -1136,7 +1136,9 @@ class GrampletPane(Gtk.ScrolledWindow):
cp = configparser.ConfigParser()
try:
cp.read(filename)
except:
except Exception as err:
LOG.warning("Failed to load gramplets from %s because %s",
filename, str(err))
return [None]
for sec in cp.sections():
if sec == "Gramplet View Options":
@ -1184,7 +1186,7 @@ class GrampletPane(Gtk.ScrolledWindow):
fp.write(";; Gramps gramplets file\n")
fp.write(";; Automatically created at %s" %
time.strftime("%Y/%m/%d %H:%M:%S\n\n"))
fp.write("[Gramplet View Options\n]")
fp.write("[Gramplet View Options]\n")
fp.write("column_count=%d\n" % self.column_count)
fp.write("pane_position=%d\n" % self.pane_position)
fp.write("pane_orientation=%s\n\n" % self.pane_orientation)