Skip to content

Commit

Permalink
Fixes linting issues and regex to parse bundle IDs and library IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-br committed Oct 7, 2024
1 parent c730255 commit e91bf43
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sysdiagnose/parsers/brctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(",")
Expand All @@ -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')]
Expand Down

0 comments on commit e91bf43

Please sign in to comment.