One function

parse in kellyjonbrazil/jc

The author described this change as fix for missing dB value. It counts as a record because the check below fails on the code as it stood at ed3046bb1 and passes on 1182c9f26, with nothing else changed between the two runs.

Fix saved2025-03-31
Sharing licenceMIT · LICENSE.md
Change size+8 2

What the code was meant to do, written into the code itself as a docstring

Main text parsing function Parameters: data: (string) text data to parse raw: (boolean) unprocessed output if True quiet: (boolean) suppress warning messages if True Returns: Dictionary. Raw or processed structured data.

The change

104104 channel_data = channel_info.split(" ")
105105 if channel_data[0] == "":
106106 continue
107+
108+ if "dB" in channel_data[3]:
109+ db_value = channel_data[3].strip("[]")
110+ status = channel_data[4].strip("[]")
111+ else:
112+ db_value = "0.0db"
113+ status = channel_data[3].strip("[]")
114+
107115 playback_value = channel_data[1]
108116 percentage = channel_data[2].strip("[]") # Extract percentage e.g., "100%"
109- db_value = channel_data[3].strip("[]") # Extract db value e.g., "0.00db"
110- status = channel_data[4].strip("[]") # Extract status e.g., "on" or "off"
111117
112118 # Store channel mapping in the dictionary
113119 mapping[channel_name] = {

The check that tells the two apart

failpass·tests/test_amixer.py::AmixerTests::test_amixer_missing_db

Check file tests/test_amixer.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ited3046bb1b362bc2dc2503e23444e3ffebd2c1b5
Broken version dated2025-03-31
Modulejc.parsers.amixer
Units changedparse
Fingerprint72dff605a85bcac5
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in kellyjonbrazil/jc