Plugins/VcsPlugins/vcsMercurial/HgSummaryDialog.py

Sat, 19 Oct 2013 13:03:39 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Oct 2013 13:03:39 +0200
changeset 3034
7ce719013078
parent 3023
34ce20603bf7
child 3060
5883ce99ee12
child 3160
209a07d7e401
permissions
-rw-r--r--

Fixed various coding style issues.

2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2013 Detlev Offenbach <detlev@die-offenbachs.de>
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to show some summary information of the working
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 directory state.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import os
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
2816
05aab5164d64 A little optimization for the Mercurial interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2813
diff changeset
13 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from PyQt4.QtGui import QDialog, QDialogButtonBox
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from E5Gui import E5MessageBox
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
2816
05aab5164d64 A little optimization for the Mercurial interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2813
diff changeset
18 from .HgUtilities import prepareProcess
05aab5164d64 A little optimization for the Mercurial interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2813
diff changeset
19
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 from .Ui_HgSummaryDialog import Ui_HgSummaryDialog
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 import Preferences
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 class HgSummaryDialog(QDialog, Ui_HgSummaryDialog):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Class implementing a dialog to show some summary information of the working
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 directory state.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 def __init__(self, vcs, parent=None):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 Constructor
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param vcs reference to the vcs object
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent parent widget (QWidget)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 super().__init__(parent)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
40 self.refreshButton = self.buttonBox.addButton(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
41 self.trUtf8("Refresh"), QDialogButtonBox.ActionRole)
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
42 self.refreshButton.setToolTip(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
43 self.trUtf8("Press to refresh the summary display"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.refreshButton.setEnabled(False)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.process = None
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.vcs = vcs
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.vcs.committed.connect(self.__committed)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 def closeEvent(self, e):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 Private slot implementing a close event handler.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 @param e close event (QCloseEvent)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 if self.process is not None and \
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.process.state() != QProcess.NotRunning:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 self.process.terminate()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 QTimer.singleShot(2000, self.process.kill)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 self.process.waitForFinished(3000)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 e.accept()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 def start(self, path, mq=False):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 Public slot to start the hg summary command.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 @param path path name of the working directory (string)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 @param mq flag indicating to show the queue status as well (boolean)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 self.errorGroup.hide()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.__path = path
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.__mq = mq
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 args = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 args.append('summary')
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.vcs.addArguments(args, self.vcs.options['global'])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 args.append("--remote")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 if self.__mq:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 args.append("--mq")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 # find the root of the repo
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 repodir = self.__path
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 repodir = os.path.dirname(repodir)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 if os.path.splitdrive(repodir)[1] == os.sep:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 return
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 if self.process:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.process.kill()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.process = QProcess()
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
93 prepareProcess(self.process, Preferences.getSystem("IOEncoding"),
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
94 "C")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.process.finished.connect(self.__procFinished)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.process.readyReadStandardOutput.connect(self.__readStdout)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.process.readyReadStandardError.connect(self.__readStderr)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.process.setWorkingDirectory(repodir)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.__buffer = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.process.start('hg', args)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 procStarted = self.process.waitForStarted(5000)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 if not procStarted:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
106 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
107 self,
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.trUtf8('Process Generation Error'),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.trUtf8(
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 'The process {0} could not be started. '
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 'Ensure, that it is in the search path.'
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 ).format('hg'))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 def __finish(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
116 Private slot called when the process finished or the user pressed
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
117 the button.
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 if self.process is not None and \
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.process.state() != QProcess.NotRunning:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 self.process.terminate()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 QTimer.singleShot(2000, self.process.kill)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.process.waitForFinished(3000)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.refreshButton.setEnabled(True)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 self.process = None
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 def on_buttonBox_clicked(self, button):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 Private slot called by a button of the button box clicked.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 @param button button that was clicked (QAbstractButton)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 if button == self.buttonBox.button(QDialogButtonBox.Close):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 self.close()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 elif button == self.refreshButton:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 self.on_refreshButton_clicked()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 def __procFinished(self, exitCode, exitStatus):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 Private slot connected to the finished signal.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 @param exitCode exit code of the process (integer)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 @param exitStatus exit status of the process (QProcess.ExitStatus)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 self.__processOutput(self.__buffer)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 self.__finish()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 def __readStdout(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 Private slot to handle the readyReadStandardOutput signal.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 It reads the output of the process, formats it and inserts it into
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 the contents pane.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 if self.process is not None:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 self.process.setReadChannel(QProcess.StandardOutput)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 while self.process.canReadLine():
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
160 line = str(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
161 self.process.readLine(),
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
162 Preferences.getSystem("IOEncoding"),
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
163 'replace')
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 self.__buffer.append(line)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 def __readStderr(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 Private slot to handle the readyReadStandardError signal.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 It reads the error output of the process and inserts it into the
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 error pane.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 if self.process is not None:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 s = str(self.process.readAllStandardError(),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 Preferences.getSystem("IOEncoding"),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 'replace')
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.__showError(s)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 def __showError(self, out):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 Private slot to show some error.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 @param out error to be shown (string)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 self.errorGroup.show()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.errors.insertPlainText(out)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 self.errors.ensureCursorVisible()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 @pyqtSlot()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 def on_refreshButton_clicked(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 Private slot to refresh the status display.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 self.refreshButton.setEnabled(False)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 self.summary.clear()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 self.start(self.__path, mq=self.__mq)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 def __committed(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 Private slot called after the commit has finished.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 if self.isVisible():
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 self.on_refreshButton_clicked()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 def __processOutput(self, output):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 Private method to process the output into nice readable text.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 @param output output from the summary command (string)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 infoDict = {}
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 # step 1: parse the output
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 while output:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 line = output.pop(0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 name, value = line.split(": ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 value = value.strip()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 if name == "parent":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 if " " in value:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 parent, tags = value.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 parent = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 tags = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 rev, node = parent.split(":")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 remarks = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 if tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 if " (empty repository)" in tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 remarks.append("@EMPTY@")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 tags = tags.replace(" (empty repository)", "")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 if " (no revision checked out)" in tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 remarks.append("@NO_REVISION@")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 tags = tags.replace(" (no revision checked out)", "")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 tags = None
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 value = infoDict.get(name, [])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 if rev == "-1":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 value.append((int(rev), node, tags, None, remarks))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 message = output.pop(0).strip()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 value.append((int(rev), node, tags, message, remarks))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 elif name == "branch":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 pass
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 elif name == "bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 pass
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 elif name == "commit":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 stateDict = {}
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 if "(" in value:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 if value.startswith("("):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 states = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 remark = value[1:-1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 states, remark = value.rsplit(" (", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 remark = remark[:-1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 states = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 remark = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 states = states.split(", ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 for state in states:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 if state:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 count, category = state.split(" ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 stateDict[category] = count
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 value = (stateDict, remark)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 elif name == "update":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 if value.endswith("(current)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 value = ("@CURRENT@", 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 elif value.endswith("(update)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 value = ("@UPDATE@", value.split(" ", 1)[0], 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 elif value.endswith("(merge)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 parts = value.split(", ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 value = ("@MERGE@", parts[0].split(" ", 1)[0],
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 parts[1].split(" ", 1)[0])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 value = ("@UNKNOWN@", 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 elif name == "remote":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 if value == "(synced)":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 value = (0, 0, 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 inc = incb = outg = outgb = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 for val in value.split(", "):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 count, category = val.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 if category == "outgoing":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 outg = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 elif category.endswith("incoming"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 inc = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 elif category == "incoming bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 incb = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 elif category == "outgoing bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 outgb = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 value = (inc, outg, incb, outgb)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 elif name == "mq":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 if value == "(empty queue)":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 value = (0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 applied = unapplied = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 for val in value.split(", "):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 count, category = val.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 if category == "applied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 applied = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 elif category == "unapplied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 unapplied = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 value = (applied, unapplied)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 # ignore unknown entries
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 continue
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 infoDict[name] = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 # step 2: build the output
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 if infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 info = ["<table>"]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 pindex = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 for rev, node, tags, message, remarks in infoDict["parent"]:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 pindex += 1
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 changeset = "{0}:{1}".format(rev, node)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 if len(infoDict["parent"]) > 1:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
321 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
322 "<tr><td><b>Parent #{0}</b></td><td>{1}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 .format(pindex, changeset))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 else:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
325 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
326 "<tr><td><b>Parent</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 .format(changeset))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 if tags:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
329 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
330 "<tr><td><b>Tags</b></td><td>{0}</td></tr>")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
331 .format('<br/>'.join(tags.split())))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 if message:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
333 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
334 "<tr><td><b>Commit Message</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 .format(message))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 if remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 rem = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 if "@EMPTY@" in remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 rem.append(self.trUtf8("empty repository"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 if "@NO_REVISION@" in remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 rem.append(self.trUtf8("no revision checked out"))
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
342 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
343 "<tr><td><b>Remarks</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 .format(", ".join(rem)))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 if "branch" in infoDict:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
346 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
347 "<tr><td><b>Branch</b></td><td>{0}</td></tr>")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
348 .format(infoDict["branch"]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 if "bookmarks" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 bookmarks = infoDict["bookmarks"].split()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 for i in range(len(bookmarks)):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 if bookmarks[i].startswith("*"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 bookmarks[i] = "<b>{0}</b>".format(bookmarks[i])
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
354 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
355 "<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
356 .format('<br/>'.join(bookmarks)))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 if "commit" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 cinfo = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 for category, count in infoDict["commit"][0].items():
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 if category == "modified":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 cinfo.append(self.trUtf8("{0} modified").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 elif category == "added":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 cinfo.append(self.trUtf8("{0} added").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 elif category == "removed":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 cinfo.append(self.trUtf8("{0} removed").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 elif category == "renamed":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 cinfo.append(self.trUtf8("{0} renamed").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 elif category == "copied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 cinfo.append(self.trUtf8("{0} copied").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 elif category == "deleted":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 cinfo.append(self.trUtf8("{0} deleted").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 elif category == "unknown":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 cinfo.append(self.trUtf8("{0} unknown").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 elif category == "ignored":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 cinfo.append(self.trUtf8("{0} ignored").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 elif category == "unresolved":
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
377 cinfo.append(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
378 self.trUtf8("{0} unresolved").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 elif category == "subrepos":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 cinfo.append(self.trUtf8("{0} subrepos").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 remark = infoDict["commit"][1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 if remark == "merge":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 cinfo.append(self.trUtf8("Merge needed"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 elif remark == "new branch":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 cinfo.append(self.trUtf8("New Branch"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 elif remark == "head closed":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 cinfo.append(self.trUtf8("Head is closed"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 elif remark == "clean":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 cinfo.append(self.trUtf8("No commit required"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 elif remark == "new branch head":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 cinfo.append(self.trUtf8("New Branch Head"))
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
392 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
393 "<tr><td><b>Commit Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 .format("<br/>".join(cinfo)))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 if "update" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 if infoDict["update"][0] == "@CURRENT@":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 uinfo = self.trUtf8("current")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 elif infoDict["update"][0] == "@UPDATE@":
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
399 uinfo = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
400 "%n new changeset(s)<br/>Update required", "",
2827
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
401 infoDict["update"][1])
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 elif infoDict["update"][0] == "@MERGE@":
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
403 uinfo1 = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
404 "%n new changeset(s)", "", infoDict["update"][1])
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
405 uinfo2 = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
406 "%n branch head(s)", "", infoDict["update"][2])
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
407 uinfo = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
408 "{0}<br/>{1}<br/>Merge required",
2827
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
409 "0 is changesets, 1 is branch heads")\
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
410 .format(uinfo1, uinfo2)
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 uinfo = self.trUtf8("unknown status")
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
413 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
414 "<tr><td><b>Update Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 .format(uinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 if "remote" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 if infoDict["remote"] == (0, 0, 0, 0):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 rinfo = self.trUtf8("synched")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 else:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
420 li = []
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 if infoDict["remote"][0]:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
422 li.append(self.trUtf8("1 or more incoming"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 if infoDict["remote"][1]:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
424 li.append(self.trUtf8("{0} outgoing")
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
425 .format(infoDict["remote"][1]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 if infoDict["remote"][2]:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
427 li.append(self.trUtf8("%n incoming bookmark(s)", "",
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
428 infoDict["remote"][2]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429 if infoDict["remote"][3]:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
430 li.append(self.trUtf8("%n outgoing bookmark(s)", "",
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
431 infoDict["remote"][3]))
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
432 rinfo = "<br/>".join(li)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
433 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
434 "<tr><td><b>Remote Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 .format(rinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 if "mq" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 if infoDict["mq"] == (0, 0):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 qinfo = self.trUtf8("empty queue")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 else:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
440 li = []
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 if infoDict["mq"][0]:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
442 li.append(self.trUtf8("{0} applied")
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
443 .format(infoDict["mq"][0]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 if infoDict["mq"][1]:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
445 li.append(self.trUtf8("{0} unapplied")
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
446 .format(infoDict["mq"][1]))
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
447 qinfo = "<br/>".join(li)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
448 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
449 "<tr><td><b>Queues Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 .format(qinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 info.append("</table>")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 info = [self.trUtf8("<p>No status information available.</p>")]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 self.summary.insertHtml("\n".join(info))

eric ide

mercurial