7 Module implementing a dialog to show the output of the svn log command process. |
7 Module implementing a dialog to show the output of the svn log command process. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 try: |
11 try: |
12 str = unicode # __IGNORE_WARNING__ |
12 str = unicode |
13 except (NameError): |
13 except NameError: |
14 pass |
14 pass |
15 |
15 |
16 import os |
16 import os |
17 |
17 |
18 from PyQt4.QtCore import QTimer, QByteArray, QProcess, QRegExp, QUrl, pyqtSlot |
18 from PyQt4.QtCore import QTimer, QByteArray, QProcess, QRegExp, QUrl, pyqtSlot |
50 |
50 |
51 self.process = QProcess() |
51 self.process = QProcess() |
52 self.vcs = vcs |
52 self.vcs = vcs |
53 |
53 |
54 self.contents.setHtml( |
54 self.contents.setHtml( |
55 self.trUtf8('<b>Processing your request, please wait...</b>')) |
55 self.tr('<b>Processing your request, please wait...</b>')) |
56 |
56 |
57 self.process.finished.connect(self.__procFinished) |
57 self.process.finished.connect(self.__procFinished) |
58 self.process.readyReadStandardOutput.connect(self.__readStdout) |
58 self.process.readyReadStandardOutput.connect(self.__readStdout) |
59 self.process.readyReadStandardError.connect(self.__readStderr) |
59 self.process.readyReadStandardError.connect(self.__readStderr) |
60 |
60 |
75 self.rx_flags = QRegExp(' ([ADM])( .*)\\s*') |
75 self.rx_flags = QRegExp(' ([ADM])( .*)\\s*') |
76 # three blanks followed by A or D or M |
76 # three blanks followed by A or D or M |
77 self.rx_changed = QRegExp('Changed .*\\s*') |
77 self.rx_changed = QRegExp('Changed .*\\s*') |
78 |
78 |
79 self.flags = { |
79 self.flags = { |
80 'A': self.trUtf8('Added'), |
80 'A': self.tr('Added'), |
81 'D': self.trUtf8('Deleted'), |
81 'D': self.tr('Deleted'), |
82 'M': self.trUtf8('Modified') |
82 'M': self.tr('Modified') |
83 } |
83 } |
84 |
84 |
85 self.revisions = [] # stack of remembered revisions |
85 self.revisions = [] # stack of remembered revisions |
86 self.revString = self.trUtf8('revision') |
86 self.revString = self.tr('revision') |
87 |
87 |
88 self.buf = [] # buffer for stdout |
88 self.buf = [] # buffer for stdout |
89 self.diff = None |
89 self.diff = None |
90 |
90 |
91 self.sbsCheckBox.setEnabled(isFile) |
91 self.sbsCheckBox.setEnabled(isFile) |
138 procStarted = self.process.waitForStarted(5000) |
138 procStarted = self.process.waitForStarted(5000) |
139 if not procStarted: |
139 if not procStarted: |
140 self.inputGroup.setEnabled(False) |
140 self.inputGroup.setEnabled(False) |
141 E5MessageBox.critical( |
141 E5MessageBox.critical( |
142 self, |
142 self, |
143 self.trUtf8('Process Generation Error'), |
143 self.tr('Process Generation Error'), |
144 self.trUtf8( |
144 self.tr( |
145 'The process {0} could not be started. ' |
145 'The process {0} could not be started. ' |
146 'Ensure, that it is in the search path.' |
146 'Ensure, that it is in the search path.' |
147 ).format('svn')) |
147 ).format('svn')) |
148 |
148 |
149 def __procFinished(self, exitCode, exitStatus): |
149 def __procFinished(self, exitCode, exitStatus): |
186 query.append(lv).append('_').append(ver) |
186 query.append(lv).append('_').append(ver) |
187 url.setEncodedQuery(query) |
187 url.setEncodedQuery(query) |
188 dstr += ' [<a href="{0}" name="{1}">{2}</a>]'.format( |
188 dstr += ' [<a href="{0}" name="{1}">{2}</a>]'.format( |
189 url.toString(), |
189 url.toString(), |
190 query, |
190 query, |
191 self.trUtf8('diff to {0}').format(lv), |
191 self.tr('diff to {0}').format(lv), |
192 ) |
192 ) |
193 except IndexError: |
193 except IndexError: |
194 pass |
194 pass |
195 dstr += '<br />\n' |
195 dstr += '<br />\n' |
196 self.contents.insertHtml(dstr) |
196 self.contents.insertHtml(dstr) |
197 |
197 |
198 dstr = self.trUtf8('<i>author: {0}</i><br />\n').format(author) |
198 dstr = self.tr('<i>author: {0}</i><br />\n').format(author) |
199 self.contents.insertHtml(dstr) |
199 self.contents.insertHtml(dstr) |
200 |
200 |
201 dstr = self.trUtf8('<i>date: {0}</i><br />\n').format(date) |
201 dstr = self.tr('<i>date: {0}</i><br />\n').format(date) |
202 self.contents.insertHtml(dstr) |
202 self.contents.insertHtml(dstr) |
203 |
203 |
204 elif self.rx_sep.exactMatch(s) or self.rx_sep2.exactMatch(s): |
204 elif self.rx_sep.exactMatch(s) or self.rx_sep2.exactMatch(s): |
205 self.contents.insertHtml('<hr />\n') |
205 self.contents.insertHtml('<hr />\n') |
206 |
206 |