raspberrypi/auto_raspbian/auto_raspbian

26 lines
674 B
Python
Executable file

#!/usr/bin/python
#http://raspberrypi.stackexchange.com/questions/15192/installing-raspbian-from-noobs-without-display
#also: https://github.com/shamiao/TRUNCATED-raspi-autoconfig
import json
f = open('test.json', 'r')
data = json.load(f)
new_dict = {}
the_stuff = []
if data["flavours"]:
print "found flavours"
flavours = data["flavours"]
for flavour in flavours:
print "found flavour [%s]" % flavour["name"]
if flavour["name"].lower() == "raspbian":
print "found raspbian"
the_stuff.append(flavour)
new_dict["flavours"] = the_stuff
print new_dict
outfile = open('new_test.json', 'w')
json.dump(new_dict, outfile)