def __init__(self):
        Stage.__init__(self)
        from selpart_gui import SelTable, SelDevice

        self.devselect = SelDevice(self, [d[0] for d in install.devices])
        self.addWidget(self.devselect, False)

        filesystems = ["ext3", "reiserfs", "ext2", "jfs", "xfs"]
        # List of mount-point suggestions
        mountpoints = ["/", "/home", "/boot", "/var", "/opt", "/usr"]

        self.table = SelTable(self, filesystems, mountpoints)
        self.addWidget(self.table)
        self.reinit()
class SelPart(Stage):
    def stageTitle(self):
        return _("Select installation partitions")

    def getHelp(self):
        return _(
            "The device partitions used for the Arch Linux installation"
            " can be manually selected here.\n"
            "There must be at least an adequately large root ('/')"
            " partition, but the system can be split over a number of"
            " partitions, for example it is often desirable to have a"
            " separate '/home' partition to keep user data separate"
            " from system data and programs. This can be"
            " helpful when updating or changing the operating system.\n\n"
            "Also fairly common are separate partitions for one or more"
            " of '/boot', '/opt', '/usr', '/var', but it is advisable to"
            " inform yourself of the pros and cons before"
            " considering these."
        )

    def __init__(self):
        Stage.__init__(self)
        from selpart_gui import SelTable, SelDevice

        self.devselect = SelDevice(self, [d[0] for d in install.devices])
        self.addWidget(self.devselect, False)

        filesystems = ["ext3", "reiserfs", "ext2", "jfs", "xfs"]
        # List of mount-point suggestions
        mountpoints = ["/", "/home", "/boot", "/var", "/opt", "/usr"]

        self.table = SelTable(self, filesystems, mountpoints)
        self.addWidget(self.table)
        self.reinit()

    def reinit(self):
        self.mounts = install.getmounts()
        self.devselect.setdevice(install.selectedDevice())

    def setDevice(self, dev):
        self.device = dev
        install.getDeviceInfo(self.device)

        self.parts = []
        for p in install.getlinuxparts(self.device):
            if not self.ismounted(p):
                pa = install.getPartition(p)
                if not pa:
                    partno = int(re.sub("/dev/[a-z]+", "", p))
                    size, fstype = install.getPartInfo(partno)
                    pa = install.newPartition(p, size, fstype)
                self.parts.append(pa)

        self.table.renew(self.parts)

    def ismounted(self, part):
        return re.search(r"^%s " % part, self.mounts, re.M)

    def forward(self):
        for p in install.parts.values():
            if p.mountpoint == "/":
                mainWindow.goto("swaps")
                return

        popupError(_("You must specify a root ('/') partition"))