UI/CompareDialog.py

changeset 537
72b32daeb8d6
parent 500
c3abc7895a01
child 564
b3d966393ba9
equal deleted inserted replaced
536:6d8d39753c82 537:72b32daeb8d6
12 12
13 from PyQt4.QtCore import * 13 from PyQt4.QtCore import *
14 from PyQt4.QtGui import * 14 from PyQt4.QtGui import *
15 15
16 from E5Gui.E5Completers import E5FileCompleter 16 from E5Gui.E5Completers import E5FileCompleter
17 from E5Gui import E5MessageBox
17 18
18 import UI.PixmapCache 19 import UI.PixmapCache
19 20
20 from .Ui_CompareDialog import Ui_CompareDialog 21 from .Ui_CompareDialog import Ui_CompareDialog
21 22
217 try: 218 try:
218 f1 = open(filename1, "r", encoding = "utf-8") 219 f1 = open(filename1, "r", encoding = "utf-8")
219 lines1 = f1.readlines() 220 lines1 = f1.readlines()
220 f1.close() 221 f1.close()
221 except IOError: 222 except IOError:
222 QMessageBox.critical(self, 223 E5MessageBox.critical(self,
223 self.trUtf8("Compare Files"), 224 self.trUtf8("Compare Files"),
224 self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""") 225 self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""")
225 .format(filename1)) 226 .format(filename1))
226 return 227 return
227 228
229 try: 230 try:
230 f2 = open(filename2, "r", encoding = "utf-8") 231 f2 = open(filename2, "r", encoding = "utf-8")
231 lines2 = f2.readlines() 232 lines2 = f2.readlines()
232 f2.close() 233 f2.close()
233 except IOError: 234 except IOError:
234 QMessageBox.critical(self, 235 E5MessageBox.critical(self,
235 self.trUtf8("Compare Files"), 236 self.trUtf8("Compare Files"),
236 self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""") 237 self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""")
237 .format(filename2)) 238 .format(filename2))
238 return 239 return
239 240

eric ide

mercurial