from exampleinstallclass import ExampleInstallClass
import rhpl
from constants import *
from flags import flags
import os
import iutil
import types
import rpmUtils.arch

import logging
log = logging.getLogger("anaconda")


class InstallClass(ExampleInstallClass):
    # name has underscore used for mnemonics, strip if you dont need it
    id = "example-generic-desktop"
    name = ("Scientific Linux Example")
    description = ("The Example installation of %s includes a set of "
                    "software applicable for general internet usage. ")
                     
    sortPriority = 10000

    def _get_description(self):
        return _(self._description) %(productName,)
    description = property(_get_description)

    def setInstallData(self, anaconda):
	ExampleInstallClass.setInstallData(self, anaconda)

    def setGroupSelection(self, anaconda):
        ExampleInstallClass.__init__(self, anaconda.backend)

        anaconda.backend.selectGroup("core")
        anaconda.backend.selectGroup("base")
        anaconda.backend.selectGroup("admin-tools")
        anaconda.backend.selectGroup("base-x")
        anaconda.backend.selectGroup("dialup")
        anaconda.backend.selectGroup("editors")
        anaconda.backend.selectGroup("graphical-internet")
        anaconda.backend.selectGroup("graphics")
        anaconda.backend.selectGroup("kde-desktop")
        anaconda.backend.selectGroup("printing")
        anaconda.backend.selectGroup("office")
        anaconda.backend.selectGroup("sound-and-video")
        anaconda.backend.selectGroup("text-internet")
        anaconda.backend.selectPackage("thunderbird")
        anaconda.backend.selectPackage("SL_password_for_singleuser")
        anaconda.backend.deselectPackage("nmap")

    def setSteps(self, dispatch):
	ExampleInstallClass.setSteps(self, dispatch);
#	dispatch.skipStep("partition")
 	dispatch.skipStep("tasksel")
 	dispatch.skipStep("group-selection", skip = 0)
	dispatch.skipStep("confirminstall", skip = 1)

    def __init__(self, expert):
	ExampleInstallClass.__init__(self, expert)
	self.repopaths = { "base": "%s/RPMS" %(productPath,) }
        self.repopaths["example"] = "%s/SITERPMS" %(productPath,)
        self.repopaths["exampleupdates"] = "%s/updates/security" %(productPath,)
