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
1=== modified file 'checkbox-support/checkbox_support/scripts/audio_settings.py'
2--- checkbox-support/checkbox_support/scripts/audio_settings.py 2014-08-07 20:38:27 +0000
3+++ checkbox-support/checkbox_support/scripts/audio_settings.py 2015-06-08 17:01:54 +0000
4@@ -38,7 +38,7 @@
5 default_pattern = "(?<=Default %s: ).*"
6 index_regex = re.compile("(?<=index: )[0-9]*")
7 muted_regex = re.compile("(?<=Mute: ).*")
8-volume_regex = re.compile("(?<=Volume: 0:)\s*[0-9]*")
9+volume_regex = re.compile("Volume: (?:0|front-left):\s*([0-9])*")
10 name_regex = re.compile("(?<=Name:).*")
11
12 entry_pattern = "Name: %s.*?(?=Properties)"
13@@ -210,7 +210,7 @@
14 sys.exit(1)
15
16 for type in TYPES:
17- pactl_status = check_output(["pactl", "stat"],
18+ pactl_status = check_output(["pactl", "info"],
19 universal_newlines=True,
20 env=unlocalized_env())
21 default_regex = re.compile(default_pattern % type.title())
22@@ -229,7 +229,7 @@
23 print("%s_muted: %s" % (type, muted.group().strip()),
24 file=settings_file)
25
26- volume = int(volume_regex.search(entry).group().strip())
27+ volume = int(volume_regex.search(entry).group(1).strip())
28
29 print("%s_volume: %s%%" % (type, str(volume)),
30 file=settings_file)

Subscribers

People subscribed via source and target branches