Skip to content

Commit

Permalink
fixed parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Equite774 committed Apr 15, 2023
1 parent 1e27f83 commit a2165ad
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

import json
import re

import oyaml as yaml

Expand All @@ -9,7 +9,8 @@
datajson = json.loads(data)
# if yaml_level is indices,
yaml_level = datajson.get('level')
yaml_commands = datajson.get('Commands')
yaml_commands = datajson.get('Commands').rstrip()
commands = re.split('\n|, ', yaml_commands)
if 'src' in datajson:
yaml_dict = {
datajson.get('name'):
Expand All @@ -36,7 +37,7 @@
'complete':
{'status': 'false'},
'src': datajson.get('src'),
'commands': datajson.get('Commands').split(', ')
'commands': commands
}
]
}
Expand Down Expand Up @@ -67,7 +68,7 @@
'component': datajson.get('component'),
'complete':
{'status': 'false'},
'commands': datajson.get('Commands').split(', ')
'commands': commands
}
]
}
Expand Down

0 comments on commit a2165ad

Please sign in to comment.