bacnet/bacnet.py
changeset 2353 8f1a2846b2f5
parent 2250 86f61c4dfe76
child 2425 68e7da937162
equal deleted inserted replaced
2352:fec90dc70e16 2353:8f1a2846b2f5
   414             self.ObjTables["BI_Obj"].ChangesToSave = False
   414             self.ObjTables["BI_Obj"].ChangesToSave = False
   415             self.ObjTables["MSV_Obj"].ChangesToSave = False
   415             self.ObjTables["MSV_Obj"].ChangesToSave = False
   416             self.ObjTables["MSO_Obj"].ChangesToSave = False
   416             self.ObjTables["MSO_Obj"].ChangesToSave = False
   417             self.ObjTables["MSI_Obj"].ChangesToSave = False
   417             self.ObjTables["MSI_Obj"].ChangesToSave = False
   418             return True
   418             return True
   419         except:
   419         except Exception:
   420             return _("Unable to save to file \"%s\"!") % filepath
   420             return _("Unable to save to file \"%s\"!") % filepath
   421 
   421 
   422     def LoadFromFile(self, filepath):
   422     def LoadFromFile(self, filepath):
   423         # Load the data that is saved in SaveToFile()
   423         # Load the data that is saved in SaveToFile()
   424         try:
   424         try:
   425             fd = open(filepath,   "r")
   425             fd = open(filepath,   "r")
   426             self.ObjTablesData = pickle.load(fd)
   426             self.ObjTablesData = pickle.load(fd)
   427             fd.close()
   427             fd.close()
   428             return True
   428             return True
   429         except:
   429         except Exception:
   430             return _("Unable to load file \"%s\"!") % filepath
   430             return _("Unable to load file \"%s\"!") % filepath
   431 
   431 
   432     def _ExportBacnetSlave(self):
   432     def _ExportBacnetSlave(self):
   433         dialog = wx.FileDialog(self.GetCTRoot().AppFrame,
   433         dialog = wx.FileDialog(self.GetCTRoot().AppFrame,
   434                                _("Choose a file"),
   434                                _("Choose a file"),