def read_config(self):
try:
self.config = PadConfig()
except ConfigException as e:
msg = "Config error: {}. Load defaults?".format(e)
dlg = wx.MessageDialog(self.pnl, msg, "Config Error", wx.YES_NO | wx.ICON_QUESTION)
result = dlg.ShowModal() == wx.ID_YES
dlg.Destroy()
if result:
self.config = PadConfig(load_defaults=True)
else:
sys.exit(1)
for key, item in self._config_map.items():
item.Set3StateValue(getattr(self.config, key))
评论列表
文章目录