Merge lp:~sylvain-pineau/checkbox/fix-1460556 into lp:checkbox

Proposed by Sylvain Pineau
Status: Merged
Approved by: Daniel Manrique
Approved revision: 3825
Merged at revision: 3827
Proposed branch: lp:~sylvain-pineau/checkbox/fix-1460556
Merge into: lp:checkbox
Diff against target: 30 lines (+3/-3)
1 file modified
checkbox-support/checkbox_support/scripts/audio_settings.py (+3/-3)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/fix-1460556
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+261429@code.launchpad.net

Description of the change

Fixes the linked bug by fixing pactl commands and regexp in checkbox-support audio_settings script.

Tested ok on both 14.04.1 and 15.04

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

+1, good catch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'checkbox-support/checkbox_support/scripts/audio_settings.py'
--- checkbox-support/checkbox_support/scripts/audio_settings.py 2014-08-07 20:38:27 +0000
+++ checkbox-support/checkbox_support/scripts/audio_settings.py 2015-06-08 17:01:54 +0000
@@ -38,7 +38,7 @@
38default_pattern = "(?<=Default %s: ).*"38default_pattern = "(?<=Default %s: ).*"
39index_regex = re.compile("(?<=index: )[0-9]*")39index_regex = re.compile("(?<=index: )[0-9]*")
40muted_regex = re.compile("(?<=Mute: ).*")40muted_regex = re.compile("(?<=Mute: ).*")
41volume_regex = re.compile("(?<=Volume: 0:)\s*[0-9]*")41volume_regex = re.compile("Volume: (?:0|front-left):\s*([0-9])*")
42name_regex = re.compile("(?<=Name:).*")42name_regex = re.compile("(?<=Name:).*")
4343
44entry_pattern = "Name: %s.*?(?=Properties)"44entry_pattern = "Name: %s.*?(?=Properties)"
@@ -210,7 +210,7 @@
210 sys.exit(1)210 sys.exit(1)
211211
212 for type in TYPES:212 for type in TYPES:
213 pactl_status = check_output(["pactl", "stat"],213 pactl_status = check_output(["pactl", "info"],
214 universal_newlines=True,214 universal_newlines=True,
215 env=unlocalized_env())215 env=unlocalized_env())
216 default_regex = re.compile(default_pattern % type.title())216 default_regex = re.compile(default_pattern % type.title())
@@ -229,7 +229,7 @@
229 print("%s_muted: %s" % (type, muted.group().strip()),229 print("%s_muted: %s" % (type, muted.group().strip()),
230 file=settings_file)230 file=settings_file)
231231
232 volume = int(volume_regex.search(entry).group().strip())232 volume = int(volume_regex.search(entry).group(1).strip())
233233
234 print("%s_volume: %s%%" % (type, str(volume)),234 print("%s_volume: %s%%" % (type, str(volume)),
235 file=settings_file)235 file=settings_file)

Subscribers

People subscribed via source and target branches