summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-03-22 15:57:53 +0000
committerErik Troan <ewt@redhat.com>2000-03-22 15:57:53 +0000
commitfca8063edacbbc390b0a8a51681e2086bbf891d7 (patch)
tree0ff1c9a341f1bdca5f12773af789c7a3ce491763
parent8fab0b5329cb2a6a69292e312a59f8eb3f1fc941 (diff)
downloadanaconda-fca8063edacbbc390b0a8a51681e2086bbf891d7.tar.gz
anaconda-fca8063edacbbc390b0a8a51681e2086bbf891d7.tar.xz
anaconda-fca8063edacbbc390b0a8a51681e2086bbf891d7.zip
split stuff into bootdisk.py
-rw-r--r--text.py77
-rw-r--r--textw/bootdisk.py76
2 files changed, 80 insertions, 73 deletions
diff --git a/text.py b/text.py
index ffb50f51f..d76dd3d89 100644
--- a/text.py
+++ b/text.py
@@ -34,6 +34,8 @@ from textw.packages import PackageGroupWindow
from textw.packages import IndividualPackageWindow
from textw.packages import PackageDepWindow
from textw.timezone import TimezoneWindow
+from textw.bootdisk import BootDiskWindow
+from textw.bootdisk import MakeBootDiskWindow
import installclass
class LanguageWindow:
@@ -377,47 +379,6 @@ class ReconfigWelcomeWindow:
return INSTALL_OK
-class BootDiskWindow:
- def __call__(self, screen, todo):
- # we *always* do this for loopback installs
- if todo.fstab.rootOnLoop():
- return INSTALL_NOOP
-
- buttons = [ _("Yes"), _("No"), _("Back") ]
- text = _("A custom boot disk provides a way of booting into your "
- "Linux system without depending on the normal bootloader. "
- "This is useful if you don't want to install lilo on your "
- "system, another operating system removes lilo, or lilo "
- "doesn't work with your hardware configuration. A custom "
- "boot disk can also be used with the Red Hat rescue image, "
- "making it much easier to recover from severe system "
- "failures.\n\n"
- "Would you like to create a boot disk for your system?")
-
- if iutil.getArch () == "sparc":
- floppy = todo.silo.hasUsableFloppy()
- if floppy == 0:
- todo.bootdisk = 0
- return INSTALL_NOOP
- text = string.replace (text, "lilo", "silo")
- if floppy == 1:
- buttons = [ _("No"), _("Yes"), _("Back") ]
- text = string.replace (text, "\n\n",
- _("\nOn SMCC made Ultra machines floppy booting "
- "probably does not work\n\n"))
-
- rc = ButtonChoiceWindow(screen, _("Bootdisk"), text, buttons = buttons)
-
- if rc == string.lower (_("Yes")):
- todo.bootdisk = 1
-
- if rc == string.lower (_("No")):
- todo.bootdisk = 0
-
- if rc == string.lower (_("Back")):
- return INSTALL_BACK
- return INSTALL_OK
-
class XConfigWindow:
def __call__(self, screen, todo):
#
@@ -614,36 +575,6 @@ class ReconfigFinishedWindow:
return INSTALL_OK
-class BootdiskWindow:
- def __call__ (self, screen, todo):
- if not todo.needBootdisk():
- return INSTALL_NOOP
-
- rc = ButtonChoiceWindow (screen, _("Bootdisk"),
- _("Insert a blank floppy in the first floppy drive. "
- "All data on this disk will be erased during creation "
- "of the boot disk."),
- [ _("OK"), _("Skip") ])
- if rc == string.lower (_("Skip")):
- return INSTALL_OK
-
- while 1:
- try:
- todo.makeBootdisk ()
- except:
- rc = ButtonChoiceWindow (screen, _("Error"),
- _("An error occured while making the boot disk. "
- "Please make sure that there is a formatted floppy "
- "in the first floppy drive."),
- [ _("OK"), _("Skip")] )
- if rc == string.lower (_("Skip")):
- break
- continue
- else:
- break
-
- return INSTALL_OK
-
class InstallProgressWindow:
def completePackage(self, header):
def formatTime(amt):
@@ -974,7 +905,7 @@ class InstallInterface:
[_("Install System"), InstallWindow, (self.screen, todo) ],
[_("Boot Disk"), BootDiskWindow, (self.screen, todo),
"bootdisk" ],
- [_("Boot Disk"), BootdiskWindow, (self.screen, todo), "bootdisk"],
+ [_("Boot Disk"), MakeBootDiskWindow, (self.screen, todo), "bootdisk"],
[_("X Configuration"), XconfiguratorWindow, (self.screen, todo),
"xconfig"],
[_("Installation Complete"), FinishedWindow, (self.screen, todo),
@@ -995,7 +926,7 @@ class InstallInterface:
[_("Upgrade System"), InstallWindow, (self.screen, todo)],
[_("Boot Disk"), BootDiskWindow, (self.screen, todo),
"bootdisk" ],
- [_("Boot Disk"), BootdiskWindow, (self.screen, todo), "bootdisk"],
+ [_("Boot Disk"), MakeBootDiskWindow, (self.screen, todo), "bootdisk"],
[_("Upgrade Complete"), FinishedWindow, (self.screen, todo)]
]
diff --git a/textw/bootdisk.py b/textw/bootdisk.py
new file mode 100644
index 000000000..a8ac6d802
--- /dev/null
+++ b/textw/bootdisk.py
@@ -0,0 +1,76 @@
+import iutil
+from translate import _
+from snack import *
+from textw.constants import *
+
+class BootDiskWindow:
+ def __call__(self, screen, todo):
+ # we *always* do this for loopback installs
+ if todo.fstab.rootOnLoop():
+ return INSTALL_NOOP
+
+ buttons = [ _("Yes"), _("No"), _("Back") ]
+ text = _("A custom boot disk provides a way of booting into your "
+ "Linux system without depending on the normal bootloader. "
+ "This is useful if you don't want to install lilo on your "
+ "system, another operating system removes lilo, or lilo "
+ "doesn't work with your hardware configuration. A custom "
+ "boot disk can also be used with the Red Hat rescue image, "
+ "making it much easier to recover from severe system "
+ "failures.\n\n"
+ "Would you like to create a boot disk for your system?")
+
+ if iutil.getArch () == "sparc":
+ floppy = todo.silo.hasUsableFloppy()
+ if floppy == 0:
+ todo.bootdisk = 0
+ return INSTALL_NOOP
+ text = string.replace (text, "lilo", "silo")
+ if floppy == 1:
+ buttons = [ _("No"), _("Yes"), _("Back") ]
+ text = string.replace (text, "\n\n",
+ _("\nOn SMCC made Ultra machines floppy booting "
+ "probably does not work\n\n"))
+
+ rc = ButtonChoiceWindow(screen, _("Bootdisk"), text, buttons = buttons)
+
+ if rc == string.lower (_("Yes")):
+ todo.bootdisk = 1
+
+ if rc == string.lower (_("No")):
+ todo.bootdisk = 0
+
+ if rc == string.lower (_("Back")):
+ return INSTALL_BACK
+ return INSTALL_OK
+
+class MakeBootDiskWindow:
+ def __call__ (self, screen, todo):
+ if not todo.needBootdisk():
+ return INSTALL_NOOP
+
+ rc = ButtonChoiceWindow (screen, _("Bootdisk"),
+ _("Insert a blank floppy in the first floppy drive. "
+ "All data on this disk will be erased during creation "
+ "of the boot disk."),
+ [ _("OK"), _("Skip") ])
+ if rc == string.lower (_("Skip")):
+ return INSTALL_OK
+
+ while 1:
+ try:
+ todo.makeBootdisk ()
+ except:
+ rc = ButtonChoiceWindow (screen, _("Error"),
+ _("An error occured while making the boot disk. "
+ "Please make sure that there is a formatted floppy "
+ "in the first floppy drive."),
+ [ _("OK"), _("Skip")] )
+ if rc == string.lower (_("Skip")):
+ break
+ continue
+ else:
+ break
+
+ return INSTALL_OK
+