Plugins/VcsPlugins/vcsSubversion/SvnPropListDialog.py

changeset 3009
bf5ae5d7477d
parent 2771
281c9b30dd91
child 3020
542e97d4ecb3
child 3057
10516539f238
equal deleted inserted replaced
3008:7848489bcb92 3009:bf5ae5d7477d
2 2
3 # Copyright (c) 2003 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2003 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a dialog to show the output of the svn proplist command process. 7 Module implementing a dialog to show the output of the svn proplist command
8 process.
8 """ 9 """
9 10
10 from PyQt4.QtCore import QTimer, QProcess, QProcessEnvironment, QRegExp, Qt 11 from PyQt4.QtCore import QTimer, QProcess, QProcessEnvironment, QRegExp, Qt
11 from PyQt4.QtGui import QWidget, QHeaderView, QDialogButtonBox, QTreeWidgetItem 12 from PyQt4.QtGui import QWidget, QHeaderView, QDialogButtonBox, QTreeWidgetItem
12 13
17 import Preferences 18 import Preferences
18 19
19 20
20 class SvnPropListDialog(QWidget, Ui_SvnPropListDialog): 21 class SvnPropListDialog(QWidget, Ui_SvnPropListDialog):
21 """ 22 """
22 Class implementing a dialog to show the output of the svn proplist command process. 23 Class implementing a dialog to show the output of the svn proplist command
24 process.
23 """ 25 """
24 def __init__(self, vcs, parent=None): 26 def __init__(self, vcs, parent=None):
25 """ 27 """
26 Constructor 28 Constructor
27 29
127 'Ensure, that it is in the search path.' 129 'Ensure, that it is in the search path.'
128 ).format('svn')) 130 ).format('svn'))
129 131
130 def __finish(self): 132 def __finish(self):
131 """ 133 """
132 Private slot called when the process finished or the user pressed the button. 134 Private slot called when the process finished or the user pressed the
135 button.
133 """ 136 """
134 if self.process is not None and \ 137 if self.process is not None and \
135 self.process.state() != QProcess.NotRunning: 138 self.process.state() != QProcess.NotRunning:
136 self.process.terminate() 139 self.process.terminate()
137 QTimer.singleShot(2000, self.process.kill) 140 QTimer.singleShot(2000, self.process.kill)
184 s = str(self.process.readLine(), 187 s = str(self.process.readLine(),
185 Preferences.getSystem("IOEncoding"), 188 Preferences.getSystem("IOEncoding"),
186 'replace') 189 'replace')
187 if self.rx_path.exactMatch(s): 190 if self.rx_path.exactMatch(s):
188 if self.lastProp: 191 if self.lastProp:
189 self.__generateItem(self.lastPath, self.lastProp, self.propBuffer) 192 self.__generateItem(
193 self.lastPath, self.lastProp, self.propBuffer)
190 self.lastPath = self.rx_path.cap(1) 194 self.lastPath = self.rx_path.cap(1)
191 self.lastProp = None 195 self.lastProp = None
192 self.propBuffer = "" 196 self.propBuffer = ""
193 elif self.rx_prop.exactMatch(s): 197 elif self.rx_prop.exactMatch(s):
194 if self.lastProp: 198 if self.lastProp:
195 self.__generateItem(self.lastPath, self.lastProp, self.propBuffer) 199 self.__generateItem(
200 self.lastPath, self.lastProp, self.propBuffer)
196 self.lastProp = self.rx_prop.cap(1) 201 self.lastProp = self.rx_prop.cap(1)
197 self.propBuffer = self.rx_prop.cap(2) 202 self.propBuffer = self.rx_prop.cap(2)
198 else: 203 else:
199 self.propBuffer += ' ' 204 self.propBuffer += ' '
200 self.propBuffer += s 205 self.propBuffer += s

eric ide

mercurial