from installclass import BaseInstallClass
import os
from kickstart import Script

class FermiInstallClass(BaseInstallClass):
    pixmap = "workstation.png"

    def postAction(self, rootPath, serial):
	for script in self.postScripts:
            script.run(rootPath, serial)

    def getFermiTextFile(self, filename):
	
	file = ""
#	fullfilename = todo.method.getFilename(filename,None)
	fullfilename = "/mnt/source/" + filename
	for n in open(fullfilename).readlines():
		file = file + n
	return file 
	
    def __init__(self, expert):
	BaseInstallClass.__init__(self)
	
	self.setFirewall( enable = 0, policy = 0, trusts = [], ports = "",
                    dhcp = 0, ssh = 0, telnet = 0, smtp = 0, http = 0,
                    ftp = 0)

        self.postScripts = []
	scriptInterp="/bin/sh"
	scriptChroot=0
        ferminame = "Fermi/common/scripts/post.sh"
	script = self.getFermiTextFile(ferminame)
        s = Script(script,scriptInterp,scriptChroot)
	self.postScripts.append(s)
