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

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1340
Proposed branch: lp:~cr3/checkbox/954587
Merge into: lp:checkbox
Diff against target: 71 lines (+7/-24)
2 files modified
debian/changelog (+4/-1)
scripts/network_bandwidth_test (+3/-23)
To merge this branch: bzr merge lp:~cr3/checkbox/954587
Reviewer Review Type Date Requested Status
Checkbox Developers Pending
Review via email: mp+99412@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Awesome, thanks!

Merging...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-03-21 22:09:17 +0000
3+++ debian/changelog 2012-03-26 19:45:28 +0000
4@@ -8,12 +8,15 @@
5 * plugins/jobs_info.py: Checkbox doesn't warn that invalid whitelist patterns
6 are being used (LP: #937651)
7
8+ [Marc Tardif]
9+ * Fixed string_to_type conversion in network_bandwidth_test (LP: #954587)
10+
11 [Sylvain Pineau]
12 * qt/frontend/qtfront.cpp, qt/frontend/qtfront.h, plugins/suites_prompt.py,
13 checkbox_qt/qt_interface.py, plugins/jobs_prompt.py: The selection tree is
14 now updated when recovering from a previous run (LP: #937696)
15
16- -- Jeff Lane <jeff@ubuntu.com> Wed, 21 Mar 2012 18:08:46 -0400
17+ -- Marc Tardif <marc@ubuntu.com> Mon, 26 Mar 2012 15:40:48 -0400
18
19 checkbox (0.13.5) precise; urgency=low
20
21
22=== modified file 'scripts/network_bandwidth_test'
23--- scripts/network_bandwidth_test 2011-07-15 18:35:30 +0000
24+++ scripts/network_bandwidth_test 2012-03-26 19:45:28 +0000
25@@ -13,27 +13,7 @@
26 from logging import StreamHandler, FileHandler, Formatter
27 from optparse import OptionParser
28
29-
30-def string_to_type(string):
31- conversion_table = {
32- "(yes|true)": lambda v: True,
33- "(no|false)": lambda v: False,
34- "\d+\.\d+": lambda v: float(v.group(0)),
35- "(\d+)( ?b)?": lambda v: int(v.group(1)),
36- "(\d+) ?kb": lambda v: int(v.group(1)) * 1024,
37- "(\d+) ?mb": lambda v: int(v.group(1)) * 1024 * 1024,
38- "(\d+) ?gb": lambda v: int(v.group(1)) * 1024 * 1024 * 1024,
39- "(\d+)( ?hz)?": lambda v: int(v.group(1)),
40- "(\d+) ?khz": lambda v: int(v.group(1)) * 1024,
41- "(\d+) ?mhz": lambda v: int(v.group(1)) * 1024 * 1024,
42- "(\d+) ?ghz": lambda v: int(v.group(1)) * 1024 * 1024 * 1024}
43-
44- for regex, func in conversion_table.items():
45- match = re.match("^%s$" % regex, string, re.IGNORECASE)
46- if match:
47- return func(match)
48-
49- return string
50+from checkbox.lib.conversion import string_to_type
51
52
53 class CommandException(Exception):
54@@ -496,7 +476,7 @@
55 #http://projects.gnome.org/NetworkManager/developers/
56 #NetworkManager D-Bus API Specifications, look for the
57 #NM_STATE enumeration to see which statuses indicate connection
58- #established and put them in this list. "3" works for NM 0.7
59+ #established and put them in this list. "3" works for NM 0.7
60 #and 0.8, while "60" and "70" work for NM 0.9.
61 STATES_CONNECTED = [3, 60, 70]
62
63@@ -515,7 +495,7 @@
64
65 def is_connected(self):
66 state = self.nm_service.state()
67- return state in self.STATES_CONNECTED
68+ return state in self.STATES_CONNECTED
69
70
71 class Application(object):

Subscribers

People subscribed via source and target branches