Merge lp:~cr3/checkbox/949957 into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1313
Proposed branch: lp:~cr3/checkbox/949957
Merge into: lp:checkbox
Diff against target: 140 lines (+27/-22)
2 files modified
checkbox_qt/qt_interface.py (+26/-22)
debian/changelog (+1/-0)
To merge this branch: bzr merge lp:~cr3/checkbox/949957
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
Review via email: mp+96580@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

looks great. thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox_qt/qt_interface.py'
2--- checkbox_qt/qt_interface.py 2012-02-29 18:49:58 +0000
3+++ checkbox_qt/qt_interface.py 2012-03-08 14:24:18 +0000
4@@ -16,20 +16,15 @@
5 # You should have received a copy of the GNU General Public License
6 # along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
7 #
8-import sys
9 import time
10-import posixpath
11-import inspect
12 from gi.repository import GObject
13-import os
14
15 from gettext import gettext as _
16 from string import Template
17
18-from checkbox.job import UNINITIATED
19 from checkbox.user_interface import (UserInterface,
20 NEXT, PREV, YES_ANSWER, NO_ANSWER, SKIP_ANSWER,
21- ANSWER_TO_STATUS, STATUS_TO_ANSWER)
22+ ANSWER_TO_STATUS)
23 import dbus
24 from dbus.mainloop.glib import DBusGMainLoop
25
26@@ -41,6 +36,7 @@
27 OPTION_TO_ANSWER = dict((o, a)
28 for a, o in ANSWER_TO_OPTION.items())
29
30+
31 class QTInterface(UserInterface):
32 def __init__(self, title, data_path):
33 super(QTInterface, self).__init__(title, data_path)
34@@ -49,20 +45,25 @@
35 while notReady:
36 try:
37 self.bus = dbus.SessionBus(mainloop=DBusGMainLoop())
38- self.qtfront = self.bus.get_object('com.canonical.QtCheckbox', '/QtCheckbox')
39- self.qtiface = dbus.Interface(self.qtfront, dbus_interface='com.canonical.QtCheckbox')
40+ self.qtfront = self.bus.get_object(
41+ 'com.canonical.QtCheckbox', '/QtCheckbox')
42+ self.qtiface = dbus.Interface(
43+ self.qtfront, dbus_interface='com.canonical.QtCheckbox')
44 self.loop = GObject.MainLoop()
45 notReady = False
46 except:
47 time.sleep(0.5)
48- self.bus.add_signal_receiver(self.onWelcomeScreenRequested, "welcomeScreenRequested")
49- self.bus.add_signal_receiver(self.onClosedFrontend, "closedFrontend")
50- self.bus.add_signal_receiver(self.onReviewTestsClicked, "reviewTestsClicked")
51- self.qtiface.setInitialState();
52+ self.bus.add_signal_receiver(
53+ self.onWelcomeScreenRequested, "welcomeScreenRequested")
54+ self.bus.add_signal_receiver(
55+ self.onClosedFrontend, "closedFrontend")
56+ self.bus.add_signal_receiver(
57+ self.onReviewTestsClicked, "reviewTestsClicked")
58+ self.qtiface.setInitialState()
59 self._set_main_title()
60
61 def onReviewTestsClicked(self):
62- self.show_url(self.report_url)
63+ self.show_url(self.report_url)
64
65 def onWelcomeScreenRequested(self):
66 pass
67@@ -91,8 +92,10 @@
68 def onFullTestsClicked():
69 self.direction = NEXT
70 self.loop.quit()
71+
72 def onCustomTestsClicked():
73 self.loop.quit()
74+
75 #Reset window title
76 self._set_main_title()
77
78@@ -115,6 +118,7 @@
79
80 def show_tree(self, text, options={}, default={}):
81 indexedOptions = {}
82+
83 def onStartTestsClicked():
84 self.direction = NEXT
85 self.loop.quit()
86@@ -127,33 +131,33 @@
87 internalIndex = 1
88 for test, state in options.iteritems():
89 if isinstance(state, dict):
90- indexedOptions[baseIndex + "." + str(internalIndex)] = { test: '' }
91+ indexedOptions[
92+ baseIndex + "." + str(internalIndex)] = {test: ''}
93 buildBranch(state, baseIndex + "." + str(internalIndex))
94 else:
95- if state == {'', ''}:
96- return
97- indexedOptions[baseIndex+"."+str(internalIndex)] = { test: state }
98- internalIndex+=1
99+ indexedOptions[
100+ baseIndex + "." + str(internalIndex)] = {test: state}
101+ internalIndex += 1
102
103 def buildDict(options, baseIndex="1"):
104 internalIndex = 1
105 branch = {}
106 while True:
107- currentIndex = baseIndex+"."+str(internalIndex)
108+ currentIndex = baseIndex + "." + str(internalIndex)
109 if currentIndex in options:
110 key = options[currentIndex].keys()[0]
111 value = options[currentIndex].values()[0]
112 if value == "menu":
113 branch[key] = buildDict(options, currentIndex)
114- else:
115+ else:
116 branch[key] = value
117- internalIndex+=1
118+ internalIndex += 1
119 else:
120 break
121 return branch
122
123 self._set_main_title()
124- newOptions = buildBranch(options)
125+ buildBranch(options)
126
127 self.qtiface.showTree(text, indexedOptions)
128 self.wait_on_signals(
129
130=== modified file 'debian/changelog'
131--- debian/changelog 2012-03-08 12:19:26 +0000
132+++ debian/changelog 2012-03-08 14:24:18 +0000
133@@ -31,6 +31,7 @@
134 (LP: #942548)
135 * Fixed filename matching expression for local jobs (LP: #942273)
136 * Fixed duplicate System Testing applications after upgrade (LP: #940627)
137+ * Linted qt_interface which had a few syntax errors (LP: #949957)
138
139 [Aurelien Gateau]
140 * lib/template.py, lib/template_i18n.py, plugins/jobs_info.py,

Subscribers

People subscribed via source and target branches