#!/usr/bin/python
# Script to add GUI for Chameleon boot loaders
import sys
import os
vol = str(sys.argv[3])
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
infile = open(plist, "r")
# check if GUI has been written or not
GUICheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written GUI Yet
if "" in line and GUICheck == False:
line = " GUI\n"
line += " No\n"
line += "\n"
GUICheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()