103 populate the dialog. |
103 populate the dialog. |
104 """ |
104 """ |
105 try: |
105 try: |
106 with open(self.__fileName, "r") as f: |
106 with open(self.__fileName, "r") as f: |
107 txt = f.read() |
107 txt = f.read() |
108 except (IOError, OSError) as err: |
108 except OSError as err: |
109 E5MessageBox.critical( |
109 E5MessageBox.critical( |
110 self, |
110 self, |
111 self.tr("Edit Plan"), |
111 self.tr("Edit Plan"), |
112 self.tr("""<p>The file <b>{0}</b> could not be read.</p>""" |
112 self.tr("""<p>The file <b>{0}</b> could not be read.</p>""" |
113 """<p>Reason: {1}</p>""").format( |
113 """<p>Reason: {1}</p>""").format( |
238 """ |
238 """ |
239 text = self.__assembleEditPlan() |
239 text = self.__assembleEditPlan() |
240 try: |
240 try: |
241 with open(self.__fileName, "w") as f: |
241 with open(self.__fileName, "w") as f: |
242 f.write(text) |
242 f.write(text) |
243 except (IOError, OSError) as err: |
243 except OSError as err: |
244 E5MessageBox.critical( |
244 E5MessageBox.critical( |
245 self, |
245 self, |
246 self.tr("Edit Plan"), |
246 self.tr("Edit Plan"), |
247 self.tr("""<p>The file <b>{0}</b> could not be read.</p>""" |
247 self.tr("""<p>The file <b>{0}</b> could not be read.</p>""" |
248 """<p>Reason: {1}</p>""").format( |
248 """<p>Reason: {1}</p>""").format( |