mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Better parser for IDE data
This commit is contained in:
@ -146,5 +146,5 @@ if "envdump" in COMMAND_LINE_TARGETS:
|
||||
env.Exit(0)
|
||||
|
||||
if "idedata" in COMMAND_LINE_TARGETS:
|
||||
print json.dumps(env.DumpIDEData())
|
||||
print "\n%s\n" % json.dumps(env.DumpIDEData())
|
||||
env.Exit(0)
|
||||
|
@ -72,11 +72,10 @@ class ProjectGenerator(object):
|
||||
raise exception.PlatformioException("\n".join(
|
||||
[result['out'], result['err']]))
|
||||
|
||||
output = result['out']
|
||||
start_index = output.index('{"')
|
||||
stop_index = output.rindex('}')
|
||||
data = json.loads(output[start_index:stop_index + 1])
|
||||
|
||||
for line in result['out'].split("\n"):
|
||||
line = line.strip()
|
||||
if line.startswith('{"') and line.endswith("}"):
|
||||
data = json.loads(line)
|
||||
return data
|
||||
|
||||
def get_project_name(self):
|
||||
|
Reference in New Issue
Block a user