Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py

changeset 537
72b32daeb8d6
parent 424
d0915392cbd7
child 539
87f9bce38a44
equal deleted inserted replaced
536:6d8d39753c82 537:72b32daeb8d6
13 13
14 from PyQt4.QtCore import * 14 from PyQt4.QtCore import *
15 from PyQt4.QtGui import * 15 from PyQt4.QtGui import *
16 16
17 from E5Gui.E5Application import e5App 17 from E5Gui.E5Application import e5App
18 from E5Gui import E5MessageBox
18 19
19 from .SvnDialogMixin import SvnDialogMixin 20 from .SvnDialogMixin import SvnDialogMixin
20 from .Ui_SvnDiffDialog import Ui_SvnDiffDialog 21 from .Ui_SvnDiffDialog import Ui_SvnDiffDialog
21 22
22 import Utilities 23 import Utilities
144 elif os.path.exists('/usr/tmp'): 145 elif os.path.exists('/usr/tmp'):
145 tmpdir = '/usr/tmp' 146 tmpdir = '/usr/tmp'
146 elif os.path.exists('/tmp'): 147 elif os.path.exists('/tmp'):
147 tmpdir = '/tmp' 148 tmpdir = '/tmp'
148 else: 149 else:
149 QMessageBox.critical(self, 150 E5MessageBox.critical(self,
150 self.trUtf8("Subversion Diff"), 151 self.trUtf8("Subversion Diff"),
151 self.trUtf8("""There is no temporary directory available.""")) 152 self.trUtf8("""There is no temporary directory available."""))
152 return 153 return
153 154
154 tmpdir = os.path.join(tmpdir, 'svn_tmp') 155 tmpdir = os.path.join(tmpdir, 'svn_tmp')
344 try: 345 try:
345 f = open(fname, "w", encoding = "utf-8") 346 f = open(fname, "w", encoding = "utf-8")
346 f.write(self.contents.toPlainText()) 347 f.write(self.contents.toPlainText())
347 f.close() 348 f.close()
348 except IOError as why: 349 except IOError as why:
349 QMessageBox.critical(self, self.trUtf8('Save Diff'), 350 E5MessageBox.critical(self, self.trUtf8('Save Diff'),
350 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' 351 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.'
351 '<br>Reason: {1}</p>') 352 '<br>Reason: {1}</p>')
352 .format(fname, str(why))) 353 .format(fname, str(why)))
353 354
354 def __showError(self, msg): 355 def __showError(self, msg):

eric ide

mercurial