eric6/Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py

changeset 7262
c4b5f3393d63
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7261:3ead033becb8 7262:c4b5f3393d63
9 9
10 10
11 import os 11 import os
12 12
13 from PyQt5.QtGui import QCursor 13 from PyQt5.QtGui import QCursor
14 from PyQt5.QtWidgets import QHeaderView, QLineEdit, QDialog, QApplication, \ 14 from PyQt5.QtWidgets import (
15 QDialogButtonBox, QTreeWidgetItem 15 QHeaderView, QLineEdit, QDialog, QApplication, QDialogButtonBox,
16 QTreeWidgetItem
17 )
16 from PyQt5.QtCore import QTimer, QProcess, QRegExp, Qt, pyqtSlot 18 from PyQt5.QtCore import QTimer, QProcess, QRegExp, Qt, pyqtSlot
17 19
18 from E5Gui import E5MessageBox 20 from E5Gui import E5MessageBox
19 21
20 from .Ui_SvnRepoBrowserDialog import Ui_SvnRepoBrowserDialog 22 from .Ui_SvnRepoBrowserDialog import Ui_SvnRepoBrowserDialog
77 """ 79 """
78 Protected slot implementing a close event handler. 80 Protected slot implementing a close event handler.
79 81
80 @param e close event (QCloseEvent) 82 @param e close event (QCloseEvent)
81 """ 83 """
82 if self.process is not None and \ 84 if (
83 self.process.state() != QProcess.NotRunning: 85 self.process is not None and
86 self.process.state() != QProcess.NotRunning
87 ):
84 self.process.terminate() 88 self.process.terminate()
85 QTimer.singleShot(2000, self.process.kill) 89 QTimer.singleShot(2000, self.process.kill)
86 self.process.waitForFinished(3000) 90 self.process.waitForFinished(3000)
87 91
88 e.accept() 92 e.accept()
177 output = str(process.readAllStandardOutput(), ioEncoding, 181 output = str(process.readAllStandardOutput(), ioEncoding,
178 'replace') 182 'replace')
179 for line in output.splitlines(): 183 for line in output.splitlines():
180 line = line.strip() 184 line = line.strip()
181 if line.startswith('<root>'): 185 if line.startswith('<root>'):
182 repoRoot = line.replace('<root>', '')\ 186 repoRoot = (
187 line.replace('<root>', '')
183 .replace('</root>', '') 188 .replace('</root>', '')
189 )
184 break 190 break
185 else: 191 else:
186 error = str(process.readAllStandardError(), 192 error = str(process.readAllStandardError(),
187 Preferences.getSystem("IOEncoding"), 193 Preferences.getSystem("IOEncoding"),
188 'replace') 194 'replace')
361 def __finish(self): 367 def __finish(self):
362 """ 368 """
363 Private slot called when the process finished or the user pressed the 369 Private slot called when the process finished or the user pressed the
364 button. 370 button.
365 """ 371 """
366 if self.process is not None and \ 372 if (
367 self.process.state() != QProcess.NotRunning: 373 self.process is not None and
374 self.process.state() != QProcess.NotRunning
375 ):
368 self.process.terminate() 376 self.process.terminate()
369 QTimer.singleShot(2000, self.process.kill) 377 QTimer.singleShot(2000, self.process.kill)
370 self.process.waitForFinished(3000) 378 self.process.waitForFinished(3000)
371 379
372 self.inputGroup.setEnabled(False) 380 self.inputGroup.setEnabled(False)

eric ide

mercurial