From d0b8d05cfedafd1b00fa2acd2b6f2ae2c8416631 Mon Sep 17 00:00:00 2001 From: Eden Refael Date: Thu, 28 Nov 2024 01:20:40 +0200 Subject: [PATCH] created raw implementation, but it's raw either or either. --- jc/parsers/amixer.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/jc/parsers/amixer.py b/jc/parsers/amixer.py index e06fd206..ae152df4 100644 --- a/jc/parsers/amixer.py +++ b/jc/parsers/amixer.py @@ -16,31 +16,17 @@ class info(): __version__ = info.version -def _process(proc_data: List[Dict]) -> List[Dict]: +def _process(proc_data: dict) -> dict: """ - Final processing to conform to the schema. - Parameters: proc_data: (List of Dictionaries) raw structured data to process Returns: - List of Dictionaries. Structured data to conform to the schema: + dictionary of amixer sget """ - # int_list = {'expires'} - # - # # in BSD style, change name to null if it is a question mark - # for entry in proc_data: - # if 'name' in entry and entry['name'] == '?': - # entry['name'] = None - # - # for key in entry: - # if key in int_list: - # entry[key] = jc.utils.convert_to_int(entry[key]) - # - # return proc_data - pass + return proc_data def parse( @@ -174,8 +160,7 @@ def parse( "dB": db_value, "status": status } - - return mapping + return _process(mapping) if raw else mapping if __name__ == '__main__':