diff options
author | Peter Jones <pjones@redhat.com> | 2009-07-29 17:29:09 -0400 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2009-08-06 14:37:46 -0400 |
commit | 3c1254a255c60933fcbd41191b784e642a838256 (patch) | |
tree | e731c0e3f1e79bb5d6221cac4dfdb261623f6101 | |
parent | 979cea3946ec0de0b2f33adfceef8057287c23b3 (diff) | |
download | anaconda-3c1254a255c60933fcbd41191b784e642a838256.tar.gz anaconda-3c1254a255c60933fcbd41191b784e642a838256.tar.xz anaconda-3c1254a255c60933fcbd41191b784e642a838256.zip |
Make questionInitializeDisk() somewhat less ugly.
This cleans up the language in questionInitializeDisk(), as well as
making the disk description a parameter, so we can provide a better
description than parted would when one is available.
-rw-r--r-- | storage/devicetree.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py index 8f7c4f0cd..4ff4727cc 100644 --- a/storage/devicetree.py +++ b/storage/devicetree.py @@ -121,7 +121,7 @@ def getLUKSPassphrase(intf, device, globalPassphrase): return (passphrase, isglobal) # Don't really know where to put this. -def questionInitializeDisk(intf=None, name=None): +def questionInitializeDisk(intf=None, name=None, description=None): retVal = False # The less destructive default if not intf or not name: pass @@ -135,15 +135,18 @@ def questionInitializeDisk(intf=None, name=None): bypath = deviceNameToDiskByPath(name) details = "" + if description is None: + description = dev.model + if bypath: details = "\n\nDevice details:\n%s" % (bypath,) rc = intf.messageWindow(_("Warning"), - _("Error processing drive %s %-0.fMB (%s).\n\n" - "Maybe it needs to be reinitialized. YOU " - "WILL LOSE ALL DATA ON THIS DRIVE IF YOU " - "REINITIALIZE IT!%s") - % (name, dev.getSize(), dev.model, details,), + _("Error processing drive:\n\n" + "%s\n%-0.fMB\n%s\n\n" + "This device may need to be reinitialized.\n\n" + "REINITIALIZING WILL CAUSE ALL DATA TO BE LOST!%s") + % (name, dev.getSize(), description, details,), type="custom", custom_buttons = [ _("_Ignore drive"), _("_Re-initialize drive") ], |