Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 3009
bf5ae5d7477d
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
14 pass 14 pass
15 15
16 import os 16 import os
17 17
18 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot 18 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot
19 from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QDialogButtonBox, QFont, \ 19 from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QDialogButtonBox, \
20 QTreeWidgetItem 20 QFont, QTreeWidgetItem
21 21
22 from E5Gui import E5MessageBox 22 from E5Gui import E5MessageBox
23 23
24 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog 24 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog
25 25
112 self.inputGroup.setEnabled(True) 112 self.inputGroup.setEnabled(True)
113 self.inputGroup.show() 113 self.inputGroup.show()
114 114
115 def __finish(self): 115 def __finish(self):
116 """ 116 """
117 Private slot called when the process finished or the user pressed the button. 117 Private slot called when the process finished or the user pressed the
118 button.
118 """ 119 """
119 if self.process is not None and \ 120 if self.process is not None and \
120 self.process.state() != QProcess.NotRunning: 121 self.process.state() != QProcess.NotRunning:
121 self.process.terminate() 122 self.process.terminate()
122 QTimer.singleShot(2000, self.process.kill) 123 QTimer.singleShot(2000, self.process.kill)
123 self.process.waitForFinished(3000) 124 self.process.waitForFinished(3000)
124 125
125 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) 126 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
126 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) 127 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
127 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 128 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
128 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) 129 self.buttonBox.button(QDialogButtonBox.Close).setFocus(
130 Qt.OtherFocusReason)
129 131
130 self.inputGroup.setEnabled(False) 132 self.inputGroup.setEnabled(False)
131 self.inputGroup.hide() 133 self.inputGroup.hide()
132 134
133 self.process = None 135 self.process = None
182 the contents pane. 184 the contents pane.
183 """ 185 """
184 self.process.setReadChannel(QProcess.StandardOutput) 186 self.process.setReadChannel(QProcess.StandardOutput)
185 187
186 while self.process.canReadLine(): 188 while self.process.canReadLine():
187 s = str(self.process.readLine(), self.__ioEncoding, 'replace').strip() 189 s = str(self.process.readLine(), self.__ioEncoding, 'replace')\
190 .strip()
188 rev, s = s.split(None, 1) 191 rev, s = s.split(None, 1)
189 try: 192 try:
190 author, text = s.split(' ', 1) 193 author, text = s.split(' ', 1)
191 except ValueError: 194 except ValueError:
192 author = s.strip() 195 author = s.strip()

eric ide

mercurial