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 |
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 |