From e91bf43e1cf0780646742cebfa27ca820045ff78 Mon Sep 17 00:00:00 2001 From: Dario Borreguero Rincon Date: Mon, 7 Oct 2024 17:28:27 +0200 Subject: [PATCH] Fixes linting issues and regex to parse bundle IDs and library IDs --- src/sysdiagnose/parsers/brctl.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sysdiagnose/parsers/brctl.py b/src/sysdiagnose/parsers/brctl.py index fe0dc9e..f959ff1 100644 --- a/src/sysdiagnose/parsers/brctl.py +++ b/src/sysdiagnose/parsers/brctl.py @@ -346,9 +346,9 @@ def parse_apps_monitor2json(data): # replace start of array string representation "{( by [ # replace end of array string representation )}" by ] # remove char " - json_str = json_str.replace("\\", "").replace('"{(', '[').replace(')}";', '],').replace('"','') - # adds double quotes to all bundle IDs or App IDs - json_str = re.sub(r'([\w\.]+)', r'"\1"', json_str) + json_str = json_str.replace("\\", "").replace('"{(', '[').replace(')}";', '],').replace('"', '') + # adds double quotes to all bundle IDs or library IDs + json_str = re.sub(r'([\w\.\-]+)', r'"\1"', json_str) # ugly fixes last_comma_index = json_str.rfind(",") @@ -359,7 +359,6 @@ def parse_apps_monitor2json(data): return json_str - def parse_folder(brctl_folder): container_list_file = [os.path.join(brctl_folder, 'brctl-container-list.txt')] container_dump_file = [os.path.join(brctl_folder, 'brctl-dump.txt')]