No functionally changes, just cleanups.
part = partedUtils.get_partition_by_name(diskset.disks, req.device)
## print req
## print "Start Cyl:%s End Cyl: %s" % (partedUtils.start_sector_to_cyl(part.geom.dev, part.geom.start),
-## partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end))
+## partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end))
def printFreespaceitem(part):
return partedUtils.get_partition_name(part), part.geom.start, part.geom.end, partedUtils.getPartSizeMB(part)
for num in number:
for request in todo[num]:
-# print "\nInserting ->",request
+# print "\nInserting ->",request
if requests.isBootable(request):
isBoot = 1
else:
# drives. this keeps us on the first possible drive
if isBoot and largestPart[1]:
break
-## print "Trying drive", drive
+## print "Trying drive", drive
disk = diskset.disks[drive]
numPrimary = len(partedUtils.get_primary_partitions(disk))
numLogical = len(partedUtils.get_logical_partitions(disk))
maxsect = long(maxfree) + startSize
imposedMax = 1
-# print "freesize, max, maxfree = ",freeSize[drive],maxsect, maxfree
-# print "freeSizeMB, maxMB = ", freeSize[drive] * sector_size/(1024.0 * 1024.0), maxsect * sector_size/(1024.0*1024.0), largestFree[drive] * sector_size/(1024.0*1024.0)
-# print "startsize = ",startSize
+# print "freesize, max, maxfree = ",freeSize[drive],maxsect, maxfree
+# print "freeSizeMB, maxMB = ", freeSize[drive] * sector_size/(1024.0 * 1024.0), maxsect * sector_size/(1024.0*1024.0), largestFree[drive] * sector_size/(1024.0*1024.0)
+# print "startsize = ",startSize
min = startSize
max = maxsect
cur = max - (diff / 2)
lastDiff = 0
-# binary search
-## print "start min, max, cur, diffs = ",min,max,cur,diff,lastDiff
+# binary search
+## print "start min, max, cur, diffs = ",min,max,cur,diff,lastDiff
inner_iter = 0
ret = PARTITION_SUCCESS # request succeeded with initial size
while (max != min) and (lastDiff != diff) and (inner_iter < 2000):
-## printNewRequestsCyl(diskset, newRequest)
+## printNewRequestsCyl(diskset, newRequest)
# XXX need to request in sectors preferably, more accurate
-## print "trying cur=%s" % cur
+## print "trying cur=%s" % cur
request.requestSize = (cur*sector_size)/1024.0/1024.0
# try adding
except PartitioningError, msg:
ret = PARTITION_FAIL
max = cur
-## print "!!!!!!!!!!! processPartitioning failed - %s" % msg
+## print "!!!!!!!!!!! processPartitioning failed - %s" % msg
lastDiff = diff
diff = max - min
-# print min, max, diff, cylsectors
-# print diskset.diskState()
+# print min, max, diff, cylsectors
+# print diskset.diskState()
cur = max - (diff / 2)
inner_iter = inner_iter + 1
-# print "sizes at end of loop - cur: %s min:%s max:%s diff:%s lastDiff:%s" % (cur,min,max,diff,lastDiff)
+# print "sizes at end of loop - cur: %s min:%s max:%s diff:%s lastDiff:%s" % (cur,min,max,diff,lastDiff)
-# freeSize[drive] = freeSize[drive] - (min - startSize)
-# print "shrinking freeSize to ",freeSize[drive], lastFreeSize
-# if freeSize[drive] < 0:
-# print "freesize < 0!"
-# freeSize[drive] = 0
+# freeSize[drive] = freeSize[drive] - (min - startSize)
+# print "shrinking freeSize to ",freeSize[drive], lastFreeSize
+# if freeSize[drive] < 0:
+# print "freesize < 0!"
+# freeSize[drive] = 0
# we could have failed on the last try, in which case we
# should go back to the smaller size
if ret == PARTITION_FAIL:
-# print "growing finally failed at size", min
+# print "growing finally failed at size", min
request.requestSize = min*sector_size/1024.0/1024.0
processPartitioning(diskset, newRequest, newParts)
-# print "end min, max, cur, diffs = ",min,max,cur,diff,lastDiff
-# print "%s took %s loops" % (request.mountpoint, inner_iter)
+# print "end min, max, cur, diffs = ",min,max,cur,diff,lastDiff
+# print "%s took %s loops" % (request.mountpoint, inner_iter)
lastFreeSize = freeSize[drive]
(free, freeSize, largestFree) = getFreeSpace(diskset)
-# print Freespace(free)
+# print Freespace(free)
if ret == PARTITION_FAIL or (max == maxsect and imposedMax):
-# print "putting ",request.uniqueID,request.mountpoint," in grownList"
+# print "putting ",request.uniqueID,request.mountpoint," in grownList"
grownList.append(request.uniqueID)
growSize[drive] = growSize[drive] - origSize[request.uniqueID]
if growSize[drive] < 0:
-# print "growsize < 0!"
+# print "growsize < 0!"
growSize[drive] = 0
def setPreexistParts(diskset, requests):
elif ret != PARTITION_SUCCESS:
# more specific message?
raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture.") %(requests.getBootableRequest()[0].mountpoint,)
-# raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest()[0].mountpoint,)
+# raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest()[0].mountpoint,)
# given clearpart specification execute it
# probably want to reset diskset and partition request lists before calling
errors = req.sanityCheckRequest(partitions)
if errors:
pomona.intf.messageWindow(_("Automatic Partitioning Errors"),
- _("The following errors occurred with your "
- "partitioning:\n\n%s\n\n"
- "Press 'OK' to reboot your system.") %
- (errors,), custom_icon='error')
+ _("The following errors occurred with your "
+ "partitioning:\n\n%s\n\n"
+ "Press 'OK' to reboot your system.")
+ % (errors,), custom_icon='error')
sys.exit(0)
try:
doPartitioning(diskset, partitions, doRefresh = 0)
except PartitioningWarning, msg:
pomona.intf.messageWindow(_("Warnings During Automatic Partitioning"),
- _("Following warnings occurred during automatic "
- "partitioning:\n\n%s") % (msg.value,),
- custom_icon='warning')
+ _("Following warnings occurred during automatic "
+ "partitioning:\n\n%s") % (msg.value,),
+ custom_icon='warning')
except PartitioningError, msg:
# restore drives to original state
diskset.refreshDevices()
ptype = fsset.fileSystemTypeGetDefault()
newrequest = partRequests.PartitionSpec(ptype,
- mountpoint = mntpt,
- size = minsize,
- maxSizeMB = maxsize,
- grow = grow,
- format = format)
+ mountpoint = mntpt,
+ size = minsize,
+ maxSizeMB = maxsize,
+ grow = grow,
+ format = format)
requests.append(newrequest)
# XXX hack but these are common strings to TUI
PARTMETHOD_TYPE_DESCR_TEXT = N_("Automatic Partitioning sets partitions "
- "based on the selected installation type. "
- "You also "
- "can customize the partitions once they "
- "have been created.\n\n"
- "The manual disk partitioning tool, Disk Druid, "
- "allows you "
- "to create partitions in an interactive "
- "environment. You can set the file system "
- "types, mount points, partition sizes, and more.")
+ "based on the selected installation type. "
+ "You also "
+ "can customize the partitions once they "
+ "have been created.\n\n"
+ "The manual disk partitioning tool, Disk Druid, "
+ "allows you "
+ "to create partitions in an interactive "
+ "environment. You can set the file system "
+ "types, mount points, partition sizes, and more.")
AUTOPART_DISK_CHOICE_DESCR_TEXT = N_("Before automatic partitioning can be "
- "set up by the installation program, you "
- "must choose how to use the space on "
- "your hard drives.")
+ "set up by the installation program, you "
+ "must choose how to use the space on "
+ "your hard drives.")
CLEARPART_TYPE_ALL_DESCR_TEXT = N_("Remove all partitions on this system")
CLEARPART_TYPE_ALL_WARNING_MSG = N_("You have chosen to remove "
- "all partitions (ALL DATA) on the "
- "following drives:%s\nAre you sure you "
- "want to do this?")
+ "all partitions (ALL DATA) on the "
+ "following drives:%s\nAre you sure you "
+ "want to do this?")
class PomonaBackend:
def __init__(self, method, instPath):
"""Abstract backend class all backends should inherit from this
- @param method: Object of InstallMethod type
- @param instPath: root path for the installation to occur"""
+ @param method: Object of InstallMethod type
+ @param instPath: root path for the installation to occur"""
self.method = method
self.instPath = instPath
if not bootDev:
bootDev = pomona.id.fsset.getEntryByMountPoint("/boot")
part = partedUtils.get_partition_by_name(pomona.id.diskset.disks,
- bootDev.device.getDevice())
+ bootDev.device.getDevice())
if part and partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end) >= 1024:
pomona.id.bootloader.above1024 = 1
dosync()
try:
pomona.id.bootloader.write(pomona.rootPath, pomona.id.fsset, pomona.id.bootloader,
- pomona.id.instLanguage, kernelList, otherList, defaultDev,
- pomona.intf)
+ pomona.id.instLanguage, kernelList, otherList, defaultDev,
+ pomona.intf)
w.pop()
except BootyNoKernelWarning:
w.pop()
if pomona.intf:
pomona.intf.messageWindow(_("Warning"),
- _("No kernel packages were installed on your "
- "system. Your boot loader configuration "
- "will not be changed."))
+ _("No kernel packages were installed on your "
+ "system. Your boot loader configuration "
+ "will not be changed."))
dosync()
# return instance of the appropriate bootloader for our arch
# and xfs is even more "special" (#117968)
if fsset.isValidXFS(dev):
pyfire.executil.execWithRedirect("/usr/sbin/xfs_freeze",
- ["/usr/sbin/xfs_freeze", "-f", mntpt],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5",
- root = instRoot)
- pyfire.executil.execWithRedirect( "/usr/sbin/xfs_freeze",
- ["/usr/sbin/xfs_freeze", "-u", mntpt],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5",
- root = instRoot)
+ ["/usr/sbin/xfs_freeze", "-f", mntpt],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5",
+ root = instRoot)
+ pyfire.executil.execWithRedirect("/usr/sbin/xfs_freeze",
+ ["/usr/sbin/xfs_freeze", "-u", mntpt],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5",
+ root = instRoot)
class BootyNoKernelWarning:
def __init__ (self, value=""):
newArgs = []
# look for kernel arguments we know should be preserved and add them
ourargs = ["speakup_synth=", "apic", "noapic", "apm=", "ide=nodma",
- "noht", "acpi=", "video=", "pci="]
+ "noht", "acpi=", "video=", "pci="]
f = open("/proc/cmdline")
cmdline = f.read()[:-1]
f.close()
self.args = " ".join(newArgs)
-
class BootImages:
"""A collection to keep track of boot images available on the system.
Examples would be:
slash = fsset.getEntryByMountPoint('/')
if not slash or not slash.device or not slash.fsystem:
raise ValueError,("Trying to pick boot devices but do not have a "
- "sane root partition. Aborting install.")
+ "sane root partition. Aborting install.")
devs.append((slash.device.getDevice(), slash.fsystem.getName()))
devs.sort()
# XXX hack city. If they're not the sort of thing that'll
# be in the device map, they shouldn't still be in the list.
if not drive.startswith('md'):
- f.write("(%s) /dev/%s\n" % (self.grubbyDiskName(drive),
- drive))
+ f.write("(%s) /dev/%s\n" % (self.grubbyDiskName(drive), drive))
f.close()
args = "--stage2=/boot/grub/stage2 "
sysconf = '/etc/sysconfig/grub'
if os.access (instRoot + sysconf, os.R_OK):
self.perms = os.stat(instRoot + sysconf)[0] & 0777
- os.rename(instRoot + sysconf,
- instRoot + sysconf + '.backup')
+ os.rename(instRoot + sysconf, instRoot + sysconf + '.backup')
# if it's an absolute symlink, just get it out of our way
elif (os.path.islink(instRoot + sysconf) and
os.readlink(instRoot + sysconf)[0] == '/'):
- os.rename(instRoot + sysconf,
- instRoot + sysconf + '.backup')
+ os.rename(instRoot + sysconf, instRoot + sysconf + '.backup')
f = open(instRoot + sysconf, 'w+')
f.write("boot=/dev/%s\n" %(grubTarget,))
# XXX forcelba never gets read back...
stage1Target = self.grubbyPartitionName(gtPart)
cmd += "install %s%s/stage1 d %s %s/stage2 p %s%s/grub.conf" % \
- (args, grubPath, stage1Target, grubPath, bPart, grubPath)
+ (args, grubPath, stage1Target, grubPath, bPart, grubPath)
cmds.append(cmd)
log.info("GRUB commands:")
# copy the stage files over into /boot
pyfire.executil.execWithRedirect("/usr/sbin/grub-install",
- ["/usr/sbin/grub-install", "--just-copy"],
- stdout = "/dev/tty5", stderr = "/dev/tty5",
- root = instRoot)
+ ["/usr/sbin/grub-install", "--just-copy"],
+ stdout = "/dev/tty5", stderr = "/dev/tty5",
+ root = instRoot)
# really install the bootloader
for cmd in cmds:
else:
syncDataToDisk(bootDev, "/", instRoot)
- pyfire.executil.execWithRedirect('/usr/sbin/grub' ,
- [ "grub", "--batch", "--no-floppy",
- "--device-map=/boot/grub/device.map" ],
- stdin = p[0],
- stdout = "/dev/tty5", stderr = "/dev/tty5",
- root = instRoot)
+ pyfire.executil.execWithRedirect("/usr/sbin/grub" ,
+ [ "grub", "--batch", "--no-floppy",
+ "--device-map=/boot/grub/device.map" ],
+ stdin = p[0],
+ stdout = "/dev/tty5", stderr = "/dev/tty5",
+ root = instRoot)
os.close(p[0])
return ""
else:
return "(%s)" %(self.grubbyDiskName(name))
- def write(self, instRoot, fsset, bl, langs, kernelList, chainList,
- defaultDev, intf):
- out = self.writeGrub(instRoot, fsset, bl, langs, kernelList,
- chainList, defaultDev)
+ def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, intf):
+ out = self.writeGrub(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev)
def getArgList(self):
args = bootloaderInfo.getArgList(self)
if self.password:
args.append("--md5pass=%s" %(self.password))
-
# XXX add location of bootloader here too
return args
# returns a product name to use for the boot loader string
def getProductName():
- # XXX Check /etc/ipfire-release here...
+ # XXX Check /etc/ipfire-release here...
return "IPFire Linux"
fd.write("%s\n" % (instance,))
return
fd.write("%s instance, containing members:\n" %
- (instance.__class__.__name__))
+ (instance.__class__.__name__))
pad = ' ' * ((level) * 2)
for key, value in instance.__dict__.items():
# Don't dump objects that are in our skip list, though ones that are
# None are probably okay.
if eval("instance.%s is not None" % key) and \
- eval("id(instance.%s)" % key) in skipList:
+ eval("id(instance.%s)" % key) in skipList:
continue
if type(value) == types.ListType:
elif childpid == 0:
# child process - run scp
args = ["scp", "-oNumberOfPasswordPrompts=1",
- "-oStrictHostKeyChecking=no"] + portArgs + \
- ["/tmp/anacdump.txt", "%s@%s:%s" % (user, host, path)]
+ "-oStrictHostKeyChecking=no"] + portArgs + \
+ ["/tmp/anacdump.txt", "%s@%s:%s" % (user, host, path)]
os.execvp("scp", args)
# parent process
if scpRc == 0:
pomona.intf.messageWindow(_("Dump Written"),
- _("Your system's state has been successfully written to "
- "the remote host. Your system will now be rebooted."),
- type="custom", custom_icon="info",
- custom_buttons=[_("_Reboot")])
+ _("Your system's state has been successfully written to "
+ "the remote host. Your system will now be rebooted."),
+ type="custom", custom_icon="info",
+ custom_buttons=[_("_Reboot")])
sys.exit(0)
elif scpRc == 1:
continue
elif scpRc == 2:
pomona.intf.messageWindow(_("Dump Not Written"),
- _("There was a problem writing the system state to the "
- "remote host."))
+ _("There was a problem writing the system state to the "
+ "remote host."))
continue
def badblocksDevice(self, entry, windowCreator, chroot='/'):
if windowCreator:
w = windowCreator(_("Checking for Bad Blocks"),
- _("Checking for bad blocks on /dev/%s...")
- % (entry.device.getDevice(),), 100)
+ _("Checking for bad blocks on /dev/%s...")
+ % (entry.device.getDevice(),), 100)
else:
w = None
os.close(p[1])
rc = inutil.execWithRedirect("mkreiserfs",
- [devicePath],
- stdin = p[0],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ [devicePath],
+ stdin = p[0],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
devicePath = entry.device.setupDevice(chroot)
label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars)
rc = inutil.execWithRedirect("reiserfstune",
- ["--label", label, devicePath],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ ["--label", label, devicePath],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
entry.setLabel(label)
devicePath = entry.device.setupDevice(chroot)
rc = inutil.execWithRedirect("mkfs.xfs",
- ["-f", "-l", "internal",
- "-i", "attr=2", devicePath],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ ["-f", "-l", "internal",
+ "-i", "attr=2", devicePath],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars)
db_cmd = "label " + label
rc = inutil.execWithRedirect("xfs_db",
- ["-x", "-c", db_cmd, devicePath],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ ["-x", "-c", db_cmd, devicePath],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
entry.setLabel(label)
label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars)
rc = inutil.execWithRedirect("e2label",
- [devicePath, label],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ [devicePath, label],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
entry.setLabel(label)
log.info("Format command: %s\n" % str(args))
rc = ext2FormatFilesystem(args, "/dev/tty5",
- progress,
- entry.mountpoint)
+ progress,
+ entry.mountpoint)
if rc:
raise SystemError
return
rc = inutil.execWithRedirect("tune2fs",
- ["-c0", "-i0", "-Odir_index",
- "-ouser_xattr,acl", devicePath],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ ["-c0", "-i0", "-Odir_index",
+ "-ouser_xattr,acl", devicePath],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
class ext2FileSystem(extFileSystem):
def __init__(self):
if not entry.fsystem or not entry.origfsystem:
raise RuntimeError, ("Trying to migrate fs w/o fsystem or "
- "origfsystem set")
+ "origfsystem set")
if entry.fsystem.getName() != "ext3":
- raise RuntimeError, ("Trying to migrate ext2 to something other "
- "than ext3")
+ raise RuntimeError, ("Trying to migrate ext2 to something other than ext3")
# if journal already exists skip
if isys.ext2HasJournal(devicePath):
return
rc = inutil.execWithRedirect("tune2fs",
- ["-j", devicePath ],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ ["-j", devicePath ],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
# At least we can avoid leaving them with a system which won't boot
if not isys.ext2HasJournal(devicePath):
log.warning("Migration of %s attempted but no journal exists after "
- "running tune2fs.\n" % (devicePath))
+ "running tune2fs.\n" % (devicePath))
if message:
rc = message(_("Error"),
- _("An error occurred migrating %s to ext3. It is "
- "possible to continue without migrating this "
- "file system if desired.\n\n"
- "Would you like to continue without migrating %s?")
- % (devicePath, devicePath), type = "yesno")
+ _("An error occurred migrating %s to ext3. It is "
+ "possible to continue without migrating this "
+ "file system if desired.\n\n"
+ "Would you like to continue without migrating %s?")
+ % (devicePath, devicePath), type = "yesno")
if rc == 0:
sys.exit(0)
entry.fsystem = entry.origfsystem ### XXX what is this?
def formatDevice(self, entry, progress, chroot='/'):
file = entry.device.setupDevice(chroot)
rc = inutil.execWithRedirect("mkswap",
- ['-v1', file],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5",
- searchPath = 1)
+ ["-v1", file],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5",
+ searchPath = 1)
if rc:
raise SystemError
swapLabel = "SWAP-%s" % (devName)
label = labelFactory.createLabel(swapLabel, self.maxLabelChars)
rc = inutil.execWithRedirect("mkswap",
- ['-v1', "-L", label, file],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5",
- searchPath = 1)
+ ["-v1", "-L", label, file],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5",
+ searchPath = 1)
if rc:
raise SystemError
entry.setLabel(label)
args.extend(devArgs)
rc = inutil.execWithRedirect("mkdosfs", args,
- stdout = "/dev/tty5",
- stderr = "/dev/tty5", searchPath = 1)
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
if rc:
raise SystemError
### debuggin'
#log.info ("fsset at %s\n"
- # "adding entry for %s\n"
- # "entry object %s, class __dict__ is %s",
- # self, entry.mountpoint, entry,
- # isys.printObject(entry.__dict__))
+ # "adding entry for %s\n"
+ # "entry object %s, class __dict__ is %s",
+ # self, entry.mountpoint, entry,
+ # isys.printObject(entry.__dict__))
insertAt = 0
device = devify(entry.device.getDevice())
fstab = fstab + entry.device.getComment()
fstab = fstab + format % (device, entry.mountpoint,
- entry.fsystem.getName(),
- entry.options, entry.fsck,
- entry.order)
+ entry.fsystem.getName(),
+ entry.options, entry.fsck,
+ entry.order)
return fstab
def mtab(self):
else:
options = "rw"
mtab = mtab + format % (devify(entry.device.getDevice()),
- entry.mountpoint,
- entry.fsystem.getName(),
- options)
+ entry.mountpoint,
+ entry.fsystem.getName(),
+ options)
return mtab
except SystemError:
if self.messageWindow:
self.messageWindow(_("Error"),
- _("An error occurred trying to "
- "initialize swap on device %s. This "
- "problem is serious, and the install "
- "cannot continue.\n\n"
- "Press <Enter> to reboot your system.")
- % (entry.device.getDevice(),))
+ _("An error occurred trying to "
+ "initialize swap on device %s. This "
+ "problem is serious, and the install "
+ "cannot continue.\n\n"
+ "Press <Enter> to reboot your system.")
+ % (entry.device.getDevice(),))
sys.exit(0)
for entry in formatted:
except OldSwapError:
if self.messageWindow:
msg = _("The swap device:\n\n /dev/%s\n\n"
- "is a version 0 Linux swap partition. If you "
- "want to use this device, you must reformat as "
- "a version 1 Linux swap partition. If you skip "
- "it, the installer will ignore it during the "
- "installation.") % (entry.device.getDevice())
+ "is a version 0 Linux swap partition. If you "
+ "want to use this device, you must reformat as "
+ "a version 1 Linux swap partition. If you skip "
+ "it, the installer will ignore it during the "
+ "installation.") % (entry.device.getDevice())
swapErrorDialog(msg, _("Reformat"), entry)
except SuspendError:
if self.messageWindow:
if upgrading:
msg = _("The swap device:\n\n /dev/%s\n\n"
- "in your /etc/fstab file is currently in "
- "use as a software suspend partition, "
- "which means your system is hibernating. "
- "To perform an upgrade, please shut down "
- "your system rather than hibernating it.") \
- % (entry.device.getDevice())
+ "in your /etc/fstab file is currently in "
+ "use as a software suspend partition, "
+ "which means your system is hibernating. "
+ "To perform an upgrade, please shut down "
+ "your system rather than hibernating it.") \
+ % (entry.device.getDevice())
else:
msg = _("The swap device:\n\n /dev/%s\n\n"
- "in your /etc/fstab file is currently in "
- "use as a software suspend partition, "
- "which means your system is hibernating. "
- "If you are performing a new install, "
- "make sure the installer is set "
- "to format all swap partitions.") \
- % (entry.device.getDevice())
+ "in your /etc/fstab file is currently in "
+ "use as a software suspend partition, "
+ "which means your system is hibernating. "
+ "If you are performing a new install, "
+ "make sure the installer is set "
+ "to format all swap partitions.") \
+ % (entry.device.getDevice())
# choose your own adventure swap partitions...
msg = msg + _("\n\nChoose Skip if you want the "
- "installer to ignore this partition during "
- "the upgrade. Choose Format to reformat "
- "the partition as swap space. Choose Reboot "
- "to restart the system.")
+ "installer to ignore this partition during "
+ "the upgrade. Choose Format to reformat "
+ "the partition as swap space. Choose Reboot "
+ "to restart the system.")
swapErrorDialog(msg, _("Format"), entry)
else:
if self.messageWindow:
if upgrading:
self.messageWindow(_("Error"),
- _("Error enabling swap device "
- "%s: %s\n\n"
- "The /etc/fstab on your "
- "upgrade partition does not "
- "reference a valid swap "
- "partition.\n\n"
- "Press OK to reboot your "
- "system.")
- % (entry.device.getDevice(), msg))
+ _("Error enabling swap device "
+ "%s: %s\n\n"
+ "The /etc/fstab on your "
+ "upgrade partition does not "
+ "reference a valid swap "
+ "partition.\n\n"
+ "Press OK to reboot your "
+ "system.")
+ % (entry.device.getDevice(), msg))
else:
self.messageWindow(_("Error"),
- _("Error enabling swap device "
- "%s: %s\n\n"
- "This most likely means this "
- "swap partition has not been "
- "initialized.\n\n"
- "Press OK to reboot your "
- "system.")
- % (entry.device.getDevice(), msg))
+ _("Error enabling swap device "
+ "%s: %s\n\n"
+ "This most likely means this "
+ "swap partition has not been "
+ "initialized.\n\n"
+ "Press OK to reboot your "
+ "system.")
+ % (entry.device.getDevice(), msg))
sys.exit(0)
def labelEntry(self, entry, chroot):
log.error("Bad blocks detected on device %s",entry.device.getDevice())
if self.messageWindow:
self.messageWindow(_("Error"),
- _("Bad blocks have been detected on "
- "device /dev/%s. We do "
- "not recommend you use this device."
- "\n\n"
- "Press <Enter> to reboot your system")
- % (entry.device.getDevice(),))
+ _("Bad blocks have been detected on "
+ "device /dev/%s. We do "
+ "not recommend you use this device."
+ "\n\n"
+ "Press <Enter> to reboot your system")
+ % (entry.device.getDevice(),))
sys.exit(0)
except SystemError:
if self.messageWindow:
self.messageWindow(_("Error"),
- _("An error occurred searching for "
- "bad blocks on %s. This problem is "
- "serious, and the install cannot "
- "continue.\n\n"
- "Press <Enter> to reboot your system.")
- % (entry.device.getDevice(),))
+ _("An error occurred searching for "
+ "bad blocks on %s. This problem is "
+ "serious, and the install cannot "
+ "continue.\n\n"
+ "Press <Enter> to reboot your system.")
+ % (entry.device.getDevice(),))
sys.exit(0)
def makeFilesystems(self, chroot='/'):
except SystemError:
if self.messageWindow:
self.messageWindow(_("Error"),
- _("An error occurred trying to "
- "format %s. This problem is "
- "serious, and the install cannot "
- "continue.\n\n"
- "Press <Enter> to reboot your system.")
- % (entry.device.getDevice(),))
+ _("An error occurred trying to "
+ "format %s. This problem is "
+ "serious, and the install cannot "
+ "continue.\n\n"
+ "Press <Enter> to reboot your system.")
+ % (entry.device.getDevice(),))
sys.exit(0)
for entry in formatted:
except SystemError:
if self.messageWindow:
self.messageWindow(_("Error"),
- _("An error occurred trying to "
- "migrate %s. This problem is "
- "serious, and the install cannot "
- "continue.\n\n"
- "Press <Enter> to reboot your system.")
- % (entry.device.getDevice(),))
+ _("An error occurred trying to "
+ "migrate %s. This problem is "
+ "serious, and the install cannot "
+ "continue.\n\n"
+ "Press <Enter> to reboot your system.")
+ % (entry.device.getDevice(),))
sys.exit(0)
self.migratedfs = 1
if self.messageWindow:
if num == errno.EEXIST:
self.messageWindow(_("Invalid mount point"),
- _("An error occurred when trying "
- "to create %s. Some element of "
- "this path is not a directory. "
- "This is a fatal error and the "
- "install cannot continue.\n\n"
- "Press <Enter> to reboot your "
- "system.") % (entry.mountpoint,))
+ _("An error occurred when trying "
+ "to create %s. Some element of "
+ "this path is not a directory. "
+ "This is a fatal error and the "
+ "install cannot continue.\n\n"
+ "Press <Enter> to reboot your "
+ "system.") % (entry.mountpoint,))
else:
self.messageWindow(_("Invalid mount point"),
- _("An error occurred when trying "
- "to create %s: %s. This is "
- "a fatal error and the install "
- "cannot continue.\n\n"
- "Press <Enter> to reboot your "
- "system.") % (entry.mountpoint, msg))
+ _("An error occurred when trying "
+ "to create %s: %s. This is "
+ "a fatal error and the install "
+ "cannot continue.\n\n"
+ "Press <Enter> to reboot your "
+ "system.") % (entry.mountpoint, msg))
sys.exit(0)
except SystemError, (num, msg):
if raiseErrors:
if self.messageWindow:
if not entry.fsystem.isLinuxNativeFS():
ret = self.messageWindow(_("Unable to mount filesystem"),
- _("An error occurred mounting "
- "device %s as %s. You may "
- "continue installation, but "
- "there may be problems.") %
- (entry.device.getDevice(),
- entry.mountpoint),
- type="custom", custom_icon="warning",
- custom_buttons=[_("_Reboot"), _("_Continue")])
+ _("An error occurred mounting "
+ "device %s as %s. You may "
+ "continue installation, but "
+ "there may be problems.")
+ % (entry.device.getDevice(),
+ entry.mountpoint),
+ type="custom", custom_icon="warning",
+ custom_buttons=[_("_Reboot"), _("_Continue")])
if ret == 0:
sys.exit(0)
else:
if pomona.id.getUpgrade() and not entry.getLabel():
errStr = _("Error mounting device %s as %s: "
- "%s\n\n"
- "Devices in /etc/fstab should be "
- "specified by label, not by device name."
- "\n\n"
- "Press OK to reboot your system.") % (entry.device.getDevice(), entry.mountpoint, msg)
+ "%s\n\n"
+ "Devices in /etc/fstab should be "
+ "specified by label, not by device name."
+ "\n\n"
+ "Press OK to reboot your system.") % (entry.device.getDevice(), entry.mountpoint, msg)
else:
errStr = _("Error mounting device %s as %s: "
- "%s\n\n"
- "This most likely means this "
- "partition has not been formatted."
- "\n\n"
- "Press OK to reboot your system.") % (entry.device.getDevice(), entry.mountpoint, msg)
+ "%s\n\n"
+ "This most likely means this "
+ "partition has not been formatted."
+ "\n\n"
+ "Press OK to reboot your system.") % (entry.device.getDevice(), entry.mountpoint, msg)
self.messageWindow(_("Error"), errStr)
isys.umount(instPath + '/proc/bus/usb', removeDir = 0)
log.info("Umount USB OK")
except:
-# log.error("Umount USB Fail")
+# log.error("Umount USB Fail")
pass
# take a slice so we don't modify self.entries
class FileSystemSetEntry:
def __init__ (self, device, mountpoint,
- fsystem=None, options=None,
- origfsystem=None, migrate=0,
- order=-1, fsck=-1, format=0,
- badblocks = 0, bytesPerInode=4096):
+ fsystem=None, options=None,
+ origfsystem=None, migrate=0,
+ order=-1, fsck=-1, format=0,
+ badblocks = 0, bytesPerInode=4096):
if not fsystem:
fsystem = fileSystemTypeGet("ext2")
self.device = device
self.order = order
if format and not fsystem.isFormattable():
raise RuntimeError, ("file system type %s is not formattable, "
- "but has been added to fsset with format "
- "flag on" % fsystem.getName())
+ "but has been added to fsset with format "
+ "flag on" % fsystem.getName())
self.format = format
self.badblocks = badblocks
self.bytesPerInode = bytesPerInode
# but it's too late now
if (self.migrate == 1) and (self.origfsystem is not None):
self.origfsystem.mount(device, "%s" % (self.mountpoint,),
- readOnly = readOnly,
- bindMount = isinstance(self.device,
- BindMountDevice),
- instroot = chroot)
+ readOnly = readOnly,
+ bindMount = isinstance(self.device,
+ BindMountDevice),
+ instroot = chroot)
else:
self.fsystem.mount(device, "%s" % (self.mountpoint,),
- readOnly = readOnly,
- bindMount = isinstance(self.device,
- BindMountDevice),
- instroot = chroot)
+ readOnly = readOnly,
+ bindMount = isinstance(self.device,
+ BindMountDevice),
+ instroot = chroot)
self.mountcount = self.mountcount + 1
mntpt = self.mountpoint
str = ("fsentry -- device: %(device)s mountpoint: %(mountpoint)s\n"
- " fsystem: %(fsystem)s format: %(format)s\n"
- " ismounted: %(mounted)s options: '%(options)s'\n"
- " bytesPerInode: %(bytesPerInode)s label: %(label)s\n"
- % {"device": self.device.getDevice(), "mountpoint": mntpt,
- "fsystem": self.fsystem.getName(), "format": self.format,
- "mounted": self.mountcount, "options": self.options,
- "bytesPerInode": self.bytesPerInode, "label": self.label})
+ " fsystem: %(fsystem)s format: %(format)s\n"
+ " ismounted: %(mounted)s options: '%(options)s'\n"
+ " bytesPerInode: %(bytesPerInode)s label: %(label)s\n"
+ % {"device": self.device.getDevice(), "mountpoint": mntpt,
+ "fsystem": self.fsystem.getName(), "format": self.format,
+ "mounted": self.mountcount, "options": self.options,
+ "bytesPerInode": self.bytesPerInode, "label": self.label})
return str
isys.ddfile(file, self.size, None)
else:
raise SystemError, (0, "swap file creation necessary, but "
- "required size is unknown.")
+ "required size is unknown.")
return file
# This is a device that describes a swap file that is sitting on
elif intf is not None:
try:
intf.messageWindow(_("Duplicate Labels"),
- _("Multiple devices on your system are "
- "labelled %s. Labels across devices must be "
- "unique for your system to function "
- "properly.\n\n"
- "Please fix this problem and restart the "
- "installation process.")
- % (label,), type="custom", custom_icon="error",
- custom_buttons=[_("_Reboot")])
+ _("Multiple devices on your system are "
+ "labelled %s. Labels across devices must be "
+ "unique for your system to function "
+ "properly.\n\n"
+ "Please fix this problem and restart the "
+ "installation process.")
+ % (label,), type="custom", custom_icon="error",
+ custom_buttons=[_("_Reboot")])
except TypeError:
intf.messageWindow(_("Invalid Label"),
- _("An invalid label was found on device "
- "%s. Please fix this problem and restart "
- "the installation process.")
- % (device,), type="custom", custom_icon="error",
- custom_buttons=[_("_Reboot")])
+ _("An invalid label was found on device "
+ "%s. Please fix this problem and restart "
+ "the installation process.")
+ % (device,), type="custom", custom_icon="error",
+ custom_buttons=[_("_Reboot")])
sys.exit(0)
else:
log.warning("Duplicate labels for %s, but no intf so trying "
- "to continue" % (label,))
+ "to continue" % (label,))
# mark these labels found on the system as used so the factory
# doesn't give them to another device
device = makeDevice(labelToDevice[label])
else:
log.warning ("fstab file has LABEL=%s, but this label "
- "could not be found on any file system", label)
+ "could not be found on any file system", label)
# bad luck, skip this entry.
continue
elif fields[2] == "swap" and not fields[0].startswith('/dev/'):
pass
entry = FileSystemSetEntry(device, fields[1], fsystem, fields[3],
- origfsystem=fsystem)
+ origfsystem=fsystem)
if label:
entry.setLabel(label)
fsset.add(entry)
def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint):
if windowCreator:
w = windowCreator(_("Formatting"),
- _("Formatting %s file system...") % (mntpoint,), 100)
+ _("Formatting %s file system...") % (mntpoint,), 100)
else:
w = None
def badPackageError(self, pkgname):
return _("The file %s cannot be opened. This is due to a missing "
- "file or perhaps a corrupt package. Please verify your "
- "installation images and that you have all the required "
- "media.\n\n"
- "If you reboot, your system will be left in an inconsistent "
- "state that will likely require reinstallation.\n\n") % pkgname
+ "file or perhaps a corrupt package. Please verify your "
+ "installation images and that you have all the required "
+ "media.\n\n"
+ "If you reboot, your system will be left in an inconsistent "
+ "state that will likely require reinstallation.\n\n") % pkgname
# mounts disc image cdNum under self.tree
def mountMedia(self, cdNum):
"drive and click Retry. Click Reboot "
" to abort the installation.")
% (cdNum,), type="custom",
- custom_icon="warning",
- custom_buttons=[_("_Reboot"),
- _("Re_try")])
+ custom_icon="warning",
+ custom_buttons=[_("_Reboot"),
+ _("Re_try")])
if ans == 0:
sys.exit(0)
elif ans == 1:
except Exception, e:
log.error("exception when umounting media: %s" % (e,))
self.messageWindow(_("Error"),
- _("An error occurred unmounting the disc. "
- "Please make sure you're not accessing "
- "the disk from the shell on tty2 "
- "and then click OK to retry."))
+ _("An error occurred unmounting the disc. "
+ "Please make sure you're not accessing "
+ "the disk from the shell on tty2 "
+ "and then click OK to retry."))
def ejectMedia(self):
isys.ejectCdrom(self.device)
def badPackageError(self, pkgname):
return _("The file %s cannot be opened. This is due to a missing "
- "file or perhaps a corrupt package. Please verify your "
- "installation images and that you have all the required "
- "media.\n\n"
- "If you reboot, your system will be left in an inconsistent "
- "state that will likely require reinstallation.\n\n") % pkgname
+ "file or perhaps a corrupt package. Please verify your "
+ "installation images and that you have all the required "
+ "media.\n\n"
+ "If you reboot, your system will be left in an inconsistent "
+ "state that will likely require reinstallation.\n\n") % pkgname
def getFilename(self, filename, callback=None, destdir=None, retry=1):
return self.tree + "/" + filename
else:
w.pop()
self.messageWindow(_("Wrong CDROM"),
- _("That's not the correct %s CDROM in /dev/%s.") % (name, dev,))
+ _("That's not the correct %s CDROM in /dev/%s.") % (name, dev,))
isys.umount(SOURCE_PATH)
isys.ejectCdrom(dev)
else:
self.intf.beep()
self.messageWindow(_("Insert CDROM"),
- _("Please insert the %s disc to continue.") % (name,))
+ _("Please insert the %s disc to continue.") % (name,))
def unlinkFilename(self, fullName):
pass
skipkey = False
def setBootloader(self, id, location=None, forceLBA=0, password=None,
- md5pass=None, appendLine="", driveorder = []):
+ md5pass=None, appendLine="", driveorder = []):
if appendLine:
id.bootloader.args.set(appendLine)
id.bootloader.setForceLBA(forceLBA)
new.append(drive)
else:
log.warning("requested drive %s in boot drive order "
- "doesn't exist" %(drive,))
+ "doesn't exist" %(drive,))
id.bootloader.drivelist = new
def setIgnoredDisks(self, id, drives):
def setSteps(self, pomona):
dispatch = pomona.dispatch
dispatch.setStepList(
- "language",
- "keyboard",
- "welcome",
- "findrootparts",
- "betanag",
- "installtype",
- "partitionobjinit",
- "parttype",
- "autopartitionexecute",
- "partition",
- "partitiondone",
- "bootloadersetup",
- "bootloader",
- "networkdevicecheck",
- "network",
- "timezone",
- "accounts",
- "reposetup",
- "basepkgsel",
- "tasksel",
- "postselection",
- "confirminstall",
- "install",
- "enablefilesystems",
- "migratefilesystems",
- "setuptime",
- "preinstallconfig",
- "installpackages",
- "postinstallconfig",
- "writeconfig",
- "firstboot",
- "instbootloader",
- "dopostaction",
- "postscripts",
- "writexconfig",
- "writeksconfig",
- "writeregkey",
- "methodcomplete",
- "copylogs",
- "setfilecon",
- "complete"
+ "language",
+ "keyboard",
+ "welcome",
+ "findrootparts",
+ "betanag",
+ "installtype",
+ "partitionobjinit",
+ "parttype",
+ "autopartitionexecute",
+ "partition",
+ "partitiondone",
+ "bootloadersetup",
+ "bootloader",
+ "networkdevicecheck",
+ "network",
+ "timezone",
+ "accounts",
+ "reposetup",
+ "basepkgsel",
+ "tasksel",
+ "postselection",
+ "confirminstall",
+ "install",
+ "enablefilesystems",
+ "migratefilesystems",
+ "setuptime",
+ "preinstallconfig",
+ "installpackages",
+ "postinstallconfig",
+ "writeconfig",
+ "firstboot",
+ "instbootloader",
+ "dopostaction",
+ "postscripts",
+ "writexconfig",
+ "writeksconfig",
+ "writeregkey",
+ "methodcomplete",
+ "copylogs",
+ "setfilecon",
+ "complete"
)
def setZeroMbr(self, id, zeroMbr):
id.instLanguage.setRuntimeLanguage(nick)
def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_ALL,
- doClear = 1):
+ doClear = 1):
autorequests = [ ("/", None, 1024, None, 1, 1, 1) ]
bootreq = getAutopartitionBoot()
def setInstallData(self, pomona):
BaseInstallClass.setInstallData(self, pomona)
BaseInstallClass.setDefaultPartitioning(self, pomona.id.partitions,
- CLEARPART_TYPE_ALL)
+ CLEARPART_TYPE_ALL)
def setSteps(self, pomona):
dispatch = pomona.dispatch
from snack import SnackScreen, ButtonChoiceWindow
screen = SnackScreen()
- ButtonChoiceWindow(screen, _('Fatal Error'),
- _('You do not have enough RAM to install %s '
- 'on this machine.\n'
- '\n'
- 'Press <return> to reboot your system.\n')
- %(name,), buttons = (_("OK"),))
+ ButtonChoiceWindow(screen, _("Fatal Error"),
+ _("You do not have enough RAM to install %s "
+ "on this machine.\n"
+ "\n"
+ "Press <return> to reboot your system.\n")
+ % (name,), buttons = (_("OK"),))
screen.finish()
sys.exit(0)
# - The keyboard
self.instClass = None
-# self.network = network.Network()
+# self.network = network.Network()
self.timezone = timezone.Timezone()
self.timezone.setTimezoneInfo(self.instLanguage.getDefaultTimeZone())
self.users = None
try:
inutil.execWithRedirect("/sbin/hwclock", args, stdin = None,
- stdout = "/dev/tty5", stderr = "/dev/tty5")
+ stdout = "/dev/tty5", stderr = "/dev/tty5")
except RuntimeError:
log.error("Failed to set clock")
while 1:
rc = pomona.intf.messageWindow( _("Warning! This is pre-release software!"),
- _("Thank you for downloading this "
- "pre-release of %s.\n\n"
- "This is not a final "
- "release and is not intended for use "
- "on production systems. The purpose of "
- "this release is to collect feedback "
- "from testers, and it is not suitable "
- "for day to day usage.\n\n"
- "To report feedback, please visit:\n\n"
- " %s\n\n"
- "and file a report against '%s'.\n")
- %(name, bugurl, name),
- type="custom", custom_icon="warning",
- custom_buttons=[_("_Exit"), _("_Install anyway")])
+ _("Thank you for downloading this "
+ "pre-release of %s.\n\n"
+ "This is not a final "
+ "release and is not intended for use "
+ "on production systems. The purpose of "
+ "this release is to collect feedback "
+ "from testers, and it is not suitable "
+ "for day to day usage.\n\n"
+ "To report feedback, please visit:\n\n"
+ " %s\n\n"
+ "and file a report against '%s'.\n")
+ % (name, bugurl, name),
+ type="custom", custom_icon="warning",
+ custom_buttons=[_("_Exit"), _("_Install anyway")])
if not rc:
msg = _("Your system will now be rebooted...")
extractor = \
subprocess.Popen(command, shell=True,
- stdout=subprocess.PIPE,
- stdin=subprocess.PIPE)
+ stdout=subprocess.PIPE,
+ stdin=subprocess.PIPE)
cb.callback(CB_START, title=_("Base system"), text=_("Installing base system..."))
def kernelVersionList(self, pomona):
kernelVersions = []
- tag2desc = {
- "-smp" : _("Symmetric multiprocessing"),
- "-xen" : _("Xen guest"),
- }
+ tag2desc = { "-smp" : _("Symmetric multiprocessing"),
+ "-xen" : _("Xen guest"), }
kernelName = "%skernel-%s" % (sname, kernelVersion)
self.window.set(float(current)/total * self.incr + self.current)
else:
warnings.warn("PakfireProgress.progressbar called when popped",
- RuntimeWarning, stacklevel=2)
+ RuntimeWarning, stacklevel=2)
def pop(self):
self.window.pop()
self.window.set(self.current)
else:
warnings.warn("PakfireProgress.set called when popped",
- RuntimeWarning, stacklevel=2)
+ RuntimeWarning, stacklevel=2)
if not passed:
return _("The mount point %s is invalid. Mount points must start "
- "with '/' and cannot end with '/', and must contain "
- "printable characters and no spaces." % mntpt)
+ "with '/' and cannot end with '/', and must contain "
+ "printable characters and no spaces." % mntpt)
else:
return None
else:
if partition == None:
intf.messageWindow(_("Unable To Delete"),
- _("You must first select a partition to delete."),
- custom_icon="error")
+ _("You must first select a partition to delete."),
+ custom_icon="error")
return 0
if partition.type & parted.PARTITION_FREESPACE:
intf.messageWindow(_("Unable To Delete"),
- _("You cannot delete free space."),
- custom_icon="error")
+ _("You cannot delete free space."),
+ custom_icon="error")
return 0
else:
device = partedUtils.get_partition_name(partition)
if ret:
if not quiet:
intf.messageWindow(_("Unable To Delete"),
- _("You cannot delete this "
- "partition, as it is an extended partition "
- "which contains %s")
- % (ret), custom_icon="error")
+ _("You cannot delete this "
+ "partition, as it is an extended partition "
+ "which contains %s")
+ % (ret), custom_icon="error")
return 0
# see if device is in our partition requests, remove
# reason why.
if state is None and request.getProtected():
state = _("This partition is holding the data for the hard "
- "drive install.")
+ "drive install.")
if state:
if not quiet:
intf.messageWindow(_("Unable To Delete"),
- _("You cannot delete this partition:\n\n") + state,
- custom_icon="error")
+ _("You cannot delete this partition:\n\n") + state,
+ custom_icon="error")
return (None, None)
if confirm and not confirmDeleteRequest(intf, request):
""" Remove all partitions currently on device """
if confirm:
rc = intf.messageWindow(_("Confirm Delete"),
- _("You are about to delete all partitions on "
- "the device '/dev/%s'.") % (device,),
- type="custom", custom_icon="warning",
- custom_buttons=[_("Cancel"), _("_Delete")])
+ _("You are about to delete all partitions on "
+ "the device '/dev/%s'.") % (device,),
+ type="custom", custom_icon="warning",
+ custom_buttons=[_("Cancel"), _("_Delete")])
if not rc:
return
if outlist != "" and not quiet:
intf.messageWindow(_("Notice"),
- _("The following partitions were not deleted "
- "because they are in use:\n\n%s") % outlist,
- custom_icon="warning")
+ _("The following partitions were not deleted "
+ "because they are in use:\n\n%s") % outlist,
+ custom_icon="warning")
return 1
if part == None:
intf.messageWindow(_("Unable To Edit"),
- _("You must select a partition to edit"), custom_icon="error")
+ _("You must select a partition to edit"), custom_icon="error")
return (None, None)
if part.type & parted.PARTITION_FREESPACE:
request = partRequests.PartitionSpec(fsset.fileSystemTypeGetDefault(),
- start = partedUtils.start_sector_to_cyl(part.geom.dev, part.geom.start),
- end = partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end),
- drive = [ partedUtils.get_partition_drive(part) ])
+ start = partedUtils.start_sector_to_cyl(part.geom.dev, part.geom.start),
+ end = partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end),
+ drive = [ partedUtils.get_partition_drive(part) ])
return ("NEW", request)
elif part.type & parted.PARTITION_EXTENDED:
ret = requestlist.containsImmutablePart(part)
if ret:
intf.messageWindow(_("Unable To Edit"),
- _("You cannot edit this "
- "partition, as it is an extended partition "
- "which contains %s") %(ret), custom_icon="error")
+ _("You cannot edit this "
+ "partition, as it is an extended partition "
+ "which contains %s") %(ret), custom_icon="error")
return 0
name = partedUtils.get_partition_name(part)
state = isNotChangable(request, requestlist)
if state is not None:
intf.messageWindow(_("Unable To Edit"),
- _("You cannot edit this partition:\n\n") + state,
- custom_icon="error")
+ _("You cannot edit this partition:\n\n") + state,
+ custom_icon="error")
return (None, None)
return ("PARTITION", request)
and (request.fstype and request.fstype.getName() != "swap")
and (not request.format)):
rc = pomona.intf.messageWindow(_("Format as Swap?"),
- _("/dev/%s has a partition type of 0x82 "
- "(Linux swap) but does not appear to "
- "be formatted as a Linux swap "
- "partition.\n\n"
- "Would you like to format this "
- "partition as a swap partition?")
- % (request.device), type = "yesno",
- custom_icon="question")
+ _("/dev/%s has a partition type of 0x82 "
+ "(Linux swap) but does not appear to "
+ "be formatted as a Linux swap "
+ "partition.\n\n"
+ "Would you like to format this "
+ "partition as a swap partition?")
+ % (request.device), type = "yesno",
+ custom_icon="question")
if rc == 1:
request.format = 1
request.fstype = fsset.fileSystemTypeGet("swap")
def queryNoFormatPreExisting(intf):
"""Ensure the user wants to use a partition without formatting."""
txt = _("You have chosen to use a pre-existing "
- "partition for this installation without formatting it. "
- "We recommend that you format this partition "
- "to make sure files from a previous operating system installation "
- "do not cause problems with this installation of Linux. "
- "However, if this partition contains files that you need "
- "to keep, such as home directories, then "
- "continue without formatting this partition.")
+ "partition for this installation without formatting it. "
+ "We recommend that you format this partition "
+ "to make sure files from a previous operating system installation "
+ "do not cause problems with this installation of Linux. "
+ "However, if this partition contains files that you need "
+ "to keep, such as home directories, then "
+ "continue without formatting this partition.")
rc = intf.messageWindow(_("Format?"), txt, type = "custom",
- custom_buttons=[_("_Modify Partition"), _("Do _Not Format")],
- custom_icon="warning")
+ custom_buttons=[_("_Modify Partition"), _("Do _Not Format")],
+ custom_icon="warning")
return rc
def partitionSanityErrors(intf, errors):
if errors:
errorstr = string.join(errors, "\n\n")
rc = intf.messageWindow(_("Error with Partitioning"),
- _("The following critical errors exist "
- "with your requested partitioning "
- "scheme. "
- "These errors must be corrected prior "
- "to continuing with your install of "
- "%s.\n\n%s") %(name, errorstr),
- custom_icon="error")
+ _("The following critical errors exist "
+ "with your requested partitioning "
+ "scheme. "
+ "These errors must be corrected prior "
+ "to continuing with your install of "
+ "%s.\n\n%s") %(name, errorstr),
+ custom_icon="error")
return rc
def partitionSanityWarnings(intf, warnings):
if warnings:
warningstr = string.join(warnings, "\n\n")
rc = intf.messageWindow(_("Partitioning Warning"),
- _("The following warnings exist with "
- "your requested partition scheme.\n\n%s"
- "\n\nWould you like to continue with "
- "your requested partitioning "
- "scheme?") % (warningstr),
- type="yesno", custom_icon="warning")
+ _("The following warnings exist with "
+ "your requested partition scheme.\n\n%s"
+ "\n\nWould you like to continue with "
+ "your requested partitioning "
+ "scheme?") % (warningstr),
+ type="yesno", custom_icon="warning")
return rc
rc = 1
if warnings:
labelstr1 = _("The following pre-existing partitions have been "
- "selected to be formatted, destroying all data.")
+ "selected to be formatted, destroying all data.")
labelstr2 = _("Select 'Yes' to continue and format these "
- "partitions, or 'No' to go back and change these "
- "settings.")
+ "partitions, or 'No' to go back and change these "
+ "settings.")
commentstr = ""
for (dev, type, mntpt) in warnings:
commentstr = commentstr + "/dev/%s %s %s\n" % (dev,type,mntpt)
rc = intf.messageWindow(_("Format Warning"), "%s\n\n%s\n\n%s" %
- (labelstr1, labelstr2, commentstr),
- type="yesno", custom_icon="warning")
+ (labelstr1, labelstr2, commentstr),
+ type="yesno", custom_icon="warning")
return rc
def getPreExistFormatWarnings(partitions, diskset):
def confirmResetPartitionState(intf):
"""Confirm reset of partitioning to that present on the system."""
rc = intf.messageWindow(_("Confirm Reset"),
- _("Are you sure you want to reset the "
- "partition table to its original state?"),
- type="yesno", custom_icon="question")
+ _("Are you sure you want to reset the "
+ "partition table to its original state?"),
+ type="yesno", custom_icon="question")
return rc
class RequestSpec:
"""Generic Request specification."""
def __init__(self, fstype, size = None, mountpoint = None, format = None,
- badblocks = None, preexist = 0, fslabel = None,
- migrate = None, origfstype = None, bytesPerInode = 4096):
+ badblocks = None, preexist = 0, fslabel = None,
+ migrate = None, origfstype = None, bytesPerInode = 4096):
"""Create a generic RequestSpec.
-
This should probably never be externally used.
"""
fsname = "None"
str = ("Generic Request -- mountpoint: %(mount)s uniqueID: %(id)s\n"
- " type: %(fstype)s format: %(format)s badblocks: %(bb)s\n"
- " device: %(dev)s migrate: %(migrate)s fslabel: %(fslabel)s\n"
- " bytesPerInode: %(bytesPerInode)s options: '%(fsopts)s'"
- % {"mount": self.mountpoint, "id": self.uniqueID,
- "fstype": fsname, "format": self.format, "bb": self.badblocks,
- "dev": self.device, "migrate": self.migrate,
- "fslabel": self.fslabel, "bytesPerInode": self.bytesPerInode,
- "fsopts": self.fsopts})
+ " type: %(fstype)s format: %(format)s badblocks: %(bb)s\n"
+ " device: %(dev)s migrate: %(migrate)s fslabel: %(fslabel)s\n"
+ " bytesPerInode: %(bytesPerInode)s options: '%(fsopts)s'"
+ % {"mount": self.mountpoint, "id": self.uniqueID,
+ "fstype": fsname, "format": self.format, "bb": self.badblocks,
+ "dev": self.device, "migrate": self.migrate,
+ "fslabel": self.fslabel, "bytesPerInode": self.bytesPerInode,
+ "fsopts": self.fsopts})
return str
def getActualSize(self, partitions, diskset):
mountpoint = self.mountpoint
entry = fsset.FileSystemSetEntry(device, mountpoint, self.fstype,
- origfsystem=self.origfstype,
- bytesPerInode=self.bytesPerInode,
- options=self.fsopts)
+ origfsystem=self.origfstype,
+ bytesPerInode=self.bytesPerInode,
+ options=self.fsopts)
if self.format:
entry.setFormat(self.format)
def doMountPointLinuxFSChecks(self):
"""Return an error string if the mountpoint is not valid for Linux FS."""
mustbeonroot = ('/bin','/dev','/sbin','/etc','/lib','/root',
- '/mnt', 'lost+found', '/proc')
+ '/mnt', 'lost+found', '/proc')
mustbeonlinuxfs = ('/', '/boot', '/var', '/tmp', '/usr', '/home',
- '/usr/share', '/usr/lib' )
+ '/usr/share', '/usr/lib' )
# these are symlinks so you cant make them mount points
otherexcept = ('/var/mail', '/usr/tmp')
if self.fstype.isMountable():
if self.mountpoint in mustbeonroot:
return _("This mount point is invalid. The %s directory must "
- "be on the / file system.") % (self.mountpoint,)
+ "be on the / file system.") % (self.mountpoint,)
elif self.mountpoint in otherexcept:
return _("The mount point %s cannot be used. It must "
- "be a symbolic link for proper system "
- "operation. Please select a different "
- "mount point.") % (self.mountpoint,)
+ "be a symbolic link for proper system "
+ "operation. Please select a different "
+ "mount point.") % (self.mountpoint,)
if not self.fstype.isLinuxNativeFS():
if self.mountpoint in mustbeonlinuxfs:
if request.mountpoint == mntpt:
if (not self.uniqueID or request.uniqueID != self.uniqueID):
return _("The mount point \"%s\" is already in use, "
- "please choose a different mount point."
- % (mntpt))
+ "please choose a different mount point."
+ % (mntpt))
return None
def doSizeSanityCheck(self):
if self.size and self.size > self.fstype.getMaxSizeMB():
return (_("The size of the %s partition (%10.2f MB) "
- "exceeds the maximum size of %10.2f MB.")
- % (self.fstype.getName(), self.size,
- self.fstype.getMaxSizeMB()))
-
+ "exceeds the maximum size of %10.2f MB.")
+ % (self.fstype.getName(), self.size,
+ self.fstype.getMaxSizeMB()))
return None
# set skipMntPtExistCheck to non-zero if you want to handle this
"""Object to define a requested partition."""
def __init__(self, fstype, size = None, mountpoint = None,
- preexist = 0, migrate = None, grow = 0, maxSizeMB = None,
- start = None, end = None, drive = None, primary = None,
- format = None, multidrive = None, bytesPerInode = 4096,
- fslabel = None):
+ preexist = 0, migrate = None, grow = 0, maxSizeMB = None,
+ start = None, end = None, drive = None, primary = None,
+ format = None, multidrive = None, bytesPerInode = 4096,
+ fslabel = None):
"""Create a new PartitionSpec object.
fstype is the fsset filesystem type.
origfs = None
RequestSpec.__init__(self, fstype = fstype, size = size,
- mountpoint = mountpoint, format = format,
- preexist = preexist, migrate = None,
- origfstype = origfs, bytesPerInode = bytesPerInode,
- fslabel = fslabel)
+ mountpoint = mountpoint, format = format,
+ preexist = preexist, migrate = None,
+ origfstype = origfs, bytesPerInode = bytesPerInode,
+ fslabel = fslabel)
self.type = REQUEST_NEW
self.grow = grow
pre = "Existing"
str = ("%(n)s Part Request -- mountpoint: %(mount)s uniqueID: %(id)s\n"
- " type: %(fstype)s format: %(format)s badblocks: %(bb)s\n"
- " device: %(dev)s drive: %(drive)s primary: %(primary)s\n"
- " size: %(size)s grow: %(grow)s maxsize: %(max)s\n"
- " start: %(start)s end: %(end)s migrate: %(migrate)s "
- " fslabel: %(fslabel)s origfstype: %(origfs)s\n"
- " bytesPerInode: %(bytesPerInode)s options: '%(fsopts)s'"
- % {"n": pre, "mount": self.mountpoint, "id": self.uniqueID,
- "fstype": fsname, "format": self.format, "dev": self.device,
- "drive": self.drive, "primary": self.primary,
- "size": self.size, "grow": self.grow, "max": self.maxSizeMB,
- "start": self.start, "end": self.end, "bb": self.badblocks,
- "migrate": self.migrate, "fslabel": self.fslabel,
- "origfs": oldfs, "bytesPerInode": self.bytesPerInode,
- "fsopts": self.fsopts})
+ " type: %(fstype)s format: %(format)s badblocks: %(bb)s\n"
+ " device: %(dev)s drive: %(drive)s primary: %(primary)s\n"
+ " size: %(size)s grow: %(grow)s maxsize: %(max)s\n"
+ " start: %(start)s end: %(end)s migrate: %(migrate)s "
+ " fslabel: %(fslabel)s origfstype: %(origfs)s\n"
+ " bytesPerInode: %(bytesPerInode)s options: '%(fsopts)s'"
+ % {"n": pre, "mount": self.mountpoint, "id": self.uniqueID,
+ "fstype": fsname, "format": self.format, "dev": self.device,
+ "drive": self.drive, "primary": self.primary,
+ "size": self.size, "grow": self.grow, "max": self.maxSizeMB,
+ "start": self.start, "end": self.end, "bb": self.badblocks,
+ "migrate": self.migrate, "fslabel": self.fslabel,
+ "origfs": oldfs, "bytesPerInode": self.bytesPerInode,
+ "fsopts": self.fsopts})
return str
if (self.size and self.maxSizeMB and (self.size > self.maxSizeMB)):
return (_("The size of the requested partition (size = %s MB) "
- "exceeds the maximum size of %s MB.")
- % (self.size, self.maxSizeMB))
+ "exceeds the maximum size of %s MB.")
+ % (self.size, self.maxSizeMB))
if self.size and self.size < 0:
return _("The size of the requested partition is "
- "negative! (size = %s MB)") % (self.size)
+ "negative! (size = %s MB)") % (self.size)
if self.start and self.start < 1:
return _("Partitions can't start below the first cylinder.")
"""Object to define a NEW requested partition."""
def __init__(self, fstype, size = None, mountpoint = None,
- grow = 0, maxSizeMB = None,
- start = None, end = None,
- drive = None, primary = None, format = None):
+ grow = 0, maxSizeMB = None,
+ start = None, end = None,
+ drive = None, primary = None, format = None):
"""Create a new NewPartitionSpec object.
fstype is the fsset filesystem type.
"""
PartitionSpec.__init__(self, fstype = fstype, size = size,
- mountpoint = mountpoint, grow = grow,
- maxSizeMB = maxSizeMB, start = start,
- end = end, drive = drive, primary = primary,
- format = format, preexist = 0)
+ mountpoint = mountpoint, grow = grow,
+ maxSizeMB = maxSizeMB, start = start,
+ end = end, drive = drive, primary = primary,
+ format = format, preexist = 0)
self.type = REQUEST_NEW
class PreexistingPartitionSpec(PartitionSpec):
"""Request to represent partitions which already existed."""
def __init__(self, fstype, size = None, start = None, end = None,
- drive = None, format = None, migrate = None,
- mountpoint = None):
+ drive = None, format = None, migrate = None,
+ mountpoint = None):
"""Create a new PreexistingPartitionSpec object.
fstype is the fsset filesystem type.
"""
PartitionSpec.__init__(self, fstype = fstype, size = size,
- start = start, end = end, drive = drive,
- format = format, migrate = migrate,
- mountpoint = mountpoint, preexist = 1)
+ start = start, end = end, drive = drive,
+ format = format, migrate = migrate,
+ mountpoint = mountpoint, preexist = 1)
self.type = REQUEST_PREEXIST
def start_sector_to_cyl(device, sector):
"""Return the closest cylinder (round down) to sector on device."""
- return int(math.floor((float(sector)
- / (device.heads * device.sectors)) + 1))
+ return int(math.floor((float(sector) / (device.heads * device.sectors)) + 1))
def end_sector_to_cyl(device, sector):
"""Return the closest cylinder (round up) to sector on device."""
- return int(math.ceil(float((sector + 1))
- / (device.heads * device.sectors)))
+ return int(math.ceil(float((sector + 1)) / (device.heads * device.sectors)))
def start_cyl_to_sector(device, cyl):
"Return the sector corresponding to cylinder as a starting cylinder."
def getPartSizeMB(partition):
"""Return the size of partition in megabytes."""
- return (partition.geom.length * partition.geom.dev.sector_size
- / 1024.0 / 1024.0)
+ return (partition.geom.length * partition.geom.dev.sector_size / 1024.0 / 1024.0)
def getDeviceSizeMB(dev):
"""Return the size of dev in megabytes."""
- return (float(dev.heads * dev.cylinders * dev.sectors) / (1024 * 1024)
- * dev.sector_size)
+ return (float(dev.heads * dev.cylinders * dev.sectors) / (1024 * 1024) * dev.sector_size)
def get_partition_by_name(disks, partname):
"""Return the parted part object associated with partname.
if intf:
rc = intf.messageWindow(_("Warning"),
- _("/dev/%s currently has a %s partition "
- "layout. To use this drive for "
- "the installation of %s, it must be "
- "re-initialized, causing the loss of "
- "ALL DATA on this drive.\n\n"
- "Would you like to re-initialize this "
- "drive?")
- %(disk.dev.path[5:], disk.type.name, name),
- type="custom", custom_buttons = [ _("_Ignore drive"),
- _("_Re-initialize drive") ], custom_icon="question")
+ _("/dev/%s currently has a %s partition "
+ "layout. To use this drive for "
+ "the installation of %s, it must be "
+ "re-initialized, causing the loss of "
+ "ALL DATA on this drive.\n\n"
+ "Would you like to re-initialize this "
+ "drive?")
+ %(disk.dev.path[5:], disk.type.name, name),
+ type="custom", custom_buttons = [ _("_Ignore drive"),
+ _("_Re-initialize drive") ], custom_icon="question")
if rc == 0:
return 1
# didn't probe as one type or another.
def validateFsType(part):
# we only care about primary and logical partitions
- if not part.type in (parted.PARTITION_PRIMARY,
- parted.PARTITION_LOGICAL):
+ if not part.type in (parted.PARTITION_PRIMARY, parted.PARTITION_LOGICAL):
return
# if the partition already has a type, no need to search
if part.fs_type:
for drive in drives:
disk = self.disks[drive]
func = lambda part: (part.is_active() and
- not (part.get_flag(parted.PARTITION_RAID)
- or part.get_flag(parted.PARTITION_LVM)))
+ not (part.get_flag(parted.PARTITION_RAID)
+ or part.get_flag(parted.PARTITION_LVM)))
parts = filter_partitions(disk, func)
for part in parts:
node = get_partition_name(part)
disk = self.disks[drive]
part = disk.next_partition()
while part:
- if (part.is_active()
- and (part.get_flag(parted.PARTITION_RAID)
- or part.get_flag(parted.PARTITION_LVM))):
+ if (part.is_active() and (part.get_flag(parted.PARTITION_RAID)
+ or part.get_flag(parted.PARTITION_LVM))):
pass
elif (part.fs_type and part.fs_type.name in fsset.getUsableLinuxFs()):
node = get_partition_name(part)
recreate = 0
if zeroMbr:
log.error("zeroMBR was set and invalid partition table "
- "found on %s" % (dev.path[5:]))
+ "found on %s" % (dev.path[5:]))
recreate = 1
elif intf is None:
DiskSet.skippedDisks.append(drive)
# if pomona is None here, we are called from labelFactory
if self.pomona is not None:
rc = intf.messageWindow(_("Warning"),
- _("The partition table on device %s was unreadable. "
- "To create new partitions it must be initialized, "
- "causing the loss of ALL DATA on this drive.\n\n"
- "This operation will override any previous "
- "installation choices about which drives to "
- "ignore.\n\n"
- "Would you like to initialize this drive, "
- "erasing ALL DATA?") % (format,), type = "yesno")
+ _("The partition table on device %s was unreadable. "
+ "To create new partitions it must be initialized, "
+ "causing the loss of ALL DATA on this drive.\n\n"
+ "This operation will override any previous "
+ "installation choices about which drives to "
+ "ignore.\n\n"
+ "Would you like to initialize this drive, "
+ "erasing ALL DATA?") % (format,), type = "yesno")
if rc == 0:
DiskSet.skippedDisks.append(drive)
continue
# check for more than 15 partitions (libata limit)
if drive.startswith('sd') and disk.get_last_partition_num() > 15:
rc = intf.messageWindow(_("Warning"),
- _("The drive /dev/%s has more than 15 "
- "partitions on it. The SCSI "
- "subsystem in the Linux kernel does "
- "not allow for more than 15 partitons "
- "at this time. You will not be able "
- "to make changes to the partitioning "
- "of this disk or use any partitions "
- "beyond /dev/%s15 in %s")
- % (drive, drive, name), type="custom",
- custom_buttons = [_("_Reboot"), _("_Continue")],
- custom_icon="warning")
+ _("The drive /dev/%s has more than 15 "
+ "partitions on it. The SCSI "
+ "subsystem in the Linux kernel does "
+ "not allow for more than 15 partitons "
+ "at this time. You will not be able "
+ "to make changes to the partitioning "
+ "of this disk or use any partitions "
+ "beyond /dev/%s15 in %s")
+ % (drive, drive, name), type="custom",
+ custom_buttons = [_("_Reboot"), _("_Continue")],
+ custom_icon="warning")
if rc == 0:
sys.exit(0)
part = disk.next_partition ()
while part:
if part.type in (parted.PARTITION_PRIMARY,
- parted.PARTITION_LOGICAL):
+ parted.PARTITION_LOGICAL):
device = get_partition_name(part)
if part.fs_type:
ptype = part.fs_type.name
rc = ""
for disk in self.disks.values():
rc = rc + ("%s: %s length %ld, maximum "
- "primary partitions: %d\n"
- % (disk.dev.path,
- disk.dev.model,
- disk.dev.length,
- disk.max_primary_partition_count))
+ "primary partitions: %d\n"
+ % (disk.dev.path,
+ disk.dev.model,
+ disk.dev.length,
+ disk.max_primary_partition_count))
part = disk.next_partition()
if part:
rc = rc + ("Device Type Filesystem Start "
- "End Length Flags\n")
+ "End Length Flags\n")
rc = rc + ("------ ---- ---------- ----- "
- "--- ------ -----\n")
+ "--- ------ -----\n")
while part:
if not part.type & parted.PARTITION_METADATA:
device = ""
fs_type_name = part.fs_type.name
partFlags = get_flags (part)
rc = rc + ("%-9s %-12s %-12s %-10ld %-10ld %-10ld %7s\n"
- % (device, part.type_name, fs_type_name,
- part.geom.start, part.geom.end, part.geom.length, partFlags))
+ % (device, part.type_name, fs_type_name,
+ part.geom.start, part.geom.end, part.geom.length, partFlags))
part = disk.next_partition(part)
return rc
"""Check that there are valid disk devices."""
if len(self.disks.keys()) == 0:
self.pomona.intf.messageWindow(_("No Drives Found"),
- _("An error has occurred - no valid devices were "
- "found on which to create new file systems. "
- "Please check your hardware for the cause "
- "of this problem."))
+ _("An error has occurred - no valid devices were "
+ "found on which to create new file systems. "
+ "Please check your hardware for the cause "
+ "of this problem."))
return True
return False
def partitioningComplete(pomona):
if pomona.dir == DISPATCH_BACK and pomona.id.fsset.isActive():
rc = pomona.intf.messageWindow(_("Installation cannot continue."),
- _("The partitioning options you have chosen "
- "have already been activated. You can "
- "no longer return to the disk editing "
- "screen. Would you like to continue "
- "with the installation process?"),
- type = "yesno")
+ _("The partitioning options you have chosen "
+ "have already been activated. You can "
+ "no longer return to the disk editing "
+ "screen. Would you like to continue "
+ "with the installation process?"),
+ type = "yesno")
if rc == 0:
sys.exit(0)
return DISPATCH_FORWARD
pomona.id.fsset.add(entry)
else:
raise RuntimeError, ("Managed to not get an entry back from "
- "request.toEntry")
+ "request.toEntry")
if inutil.memAvailable() > isys.EARLY_SWAP_RAM:
return
rc = pomona.intf.messageWindow(_("Low Memory"),
- _("As you don't have much memory in this "
- "machine, we need to turn on swap space "
- "immediately. To do this we'll have to "
- "write your new partition table to the disk "
- "immediately. Is that OK?"), "yesno")
+ _("As you don't have much memory in this "
+ "machine, we need to turn on swap space "
+ "immediately. To do this we'll have to "
+ "write your new partition table to the disk "
+ "immediately. Is that OK?"), "yesno")
if rc:
pomona.id.diskset.clearDevices()
drive = partedUtils.get_partition_drive(part)
spec = partRequests.PreexistingPartitionSpec(ptype,
- size = size,
- start = start,
- end = end,
- drive = drive,
- format = format)
+ size = size,
+ start = start,
+ end = end,
+ drive = drive,
+ format = format)
spec.device = fsset.PartedPartitionDevice(part).getDevice()
# set label if makes sense
accepting a partition will be run on the requests as well.
"""
checkSizes = [('/usr', 250), ('/tmp', 50), ('/var', 384),
- ('/home', 100), ('/boot', 75)]
+ ('/home', 100), ('/boot', 75)]
warnings = []
errors = []
slash = self.getRequestByMountPoint('/')
if not slash:
errors.append(_("You have not defined a root partition (/), "
- "which is required for installation of %s "
- "to continue.") % (name,))
+ "which is required for installation of %s "
+ "to continue.") % (name,))
if slash and slash.getActualSize(self, diskset) < 250:
warnings.append(_("Your root partition is less than 250 "
- "megabytes which is usually too small to "
- "install %s.") % (name,))
+ "megabytes which is usually too small to "
+ "install %s.") % (name,))
bootreqs = self.getBootableRequest() or []
# FIXME: missing a check to ensure this is gpt.
if int(num) > 4:
print dev, num
errors.append(_("Your boot partition isn't on one of "
- "the first four partitions and thus "
- "won't be bootable."))
-
+ "the first four partitions and thus "
+ "won't be bootable."))
for (mount, size) in checkSizes:
req = self.getRequestByMountPoint(mount)
continue
if req.getActualSize(self, diskset) < size:
warnings.append(_("Your %s partition is less than %s "
- "megabytes which is lower than recommended "
- "for a normal %s install.")
- % (mount, size, name))
+ "megabytes which is lower than recommended "
+ "for a normal %s install.")
+ % (mount, size, name))
foundSwap = 0
swapSize = 0
if usesUSB:
warnings.append(_("Installing on a USB device. This may "
- "or may not produce a working system."))
+ "or may not produce a working system."))
if usesFireWire:
warnings.append(_("Installing on a FireWire device. This may "
- "or may not produce a working system."))
+ "or may not produce a working system."))
bootreqs = self.getBootableRequest()
if bootreqs:
if foundSwap == 0:
warnings.append(_("You have not specified a swap partition. "
- "Although not strictly required in all cases, "
- "it will significantly improve performance for "
- "most installations."))
+ "Although not strictly required in all cases, "
+ "it will significantly improve performance for "
+ "most installations."))
# XXX number of swaps not exported from kernel and could change
if foundSwap >= 32:
warnings.append(_("You have specified more than 32 swap devices. "
- "The kernel for %s only supports 32 "
- "swap devices.") % (name,))
+ "The kernel for %s only supports 32 "
+ "swap devices.") % (name,))
mem = inutil.memInstalled()
rem = mem % 16384
if foundSwap and (swapSize < (mem - 8)) and (mem < 1024):
warnings.append(_("You have allocated less swap space (%dM) than "
- "available RAM (%dM) on your system. This "
- "could negatively impact performance.")
- % (swapSize, mem))
+ "available RAM (%dM) on your system. This "
+ "could negatively impact performance.")
+ % (swapSize, mem))
if warnings == []:
warnings = None
if request.preexist:
drive = partedUtils.get_partition_drive(partition)
delete = partRequests.DeleteSpec(drive, partition.geom.start,
- partition.geom.end)
+ partition.geom.end)
self.addDelete(delete)
def containsImmutablePart(self, part):
# Add a simple handler - file or stream, depending on what we're given.
def addFileHandler(self, file, addToLogger, minLevel=DEFAULT_LEVEL,
- fmtStr="%(asctime)s %(levelname)-8s: %(message)s",
- autoSetLevel=True):
+ fmtStr="%(asctime)s %(levelname)-8s: %(message)s",
+ autoSetLevel=True):
if type (file) == type ("string"):
logfileHandler = logging.FileHandler(file)
else:
# Add a handler for remote syslogs.
def addSysLogHandler(self, logger, host, port=SYSLOG_UDP_PORT,
- minLevel=DEFAULT_LEVEL):
+ minLevel=DEFAULT_LEVEL):
fmt = logging.Formatter("%(levelname)-8s %(message)s")
syslogHandler = SysLogHandler((host, port))
syslogHandler.setLevel(minLevel)
stepToClasses = {
"accounts" : ("tui_userauth", "RootPasswordWindow"),
"bootloader" : ("tui_bootloader", ("BootloaderChoiceWindow",
- "BootloaderAppendWindow",
- "BootloaderPasswordWindow")),
+ "BootloaderAppendWindow",
+ "BootloaderPasswordWindow")),
"bootloaderadvanced" : ("tui_bootloader", ("BootloaderImagesWindow",
- "BootloaderLocationWindow")),
+ "BootloaderLocationWindow")),
"complete" : ("tui_complete", "FinishedWindow"),
"confirminstall" : ("tui_confirm", "BeginInstallWindow"),
"install" : ("tui_progress", "setupForInstall"),
return self.rc
def __init__(self, screen, title, text):
- rc = ButtonChoiceWindow(screen, title, text,
- buttons=[TEXT_OK_BUTTON, _("Cancel")])
+ rc = ButtonChoiceWindow(screen, title, text, buttons=[TEXT_OK_BUTTON, _("Cancel")])
if rc == string.lower(_("Cancel")):
self.rc = 1
else:
def run(self):
log.info ("in run, screen = %s" % self.screen)
self.rc = ButtonChoiceWindow(self.screen, _("Exception Occurred"),
- self.text, self.buttons)
+ self.text, self.buttons)
def getrc(self):
return 0
try:
found = imputil.imp.find_module(file)
loaded = imputil.imp.load_module(classNames[step],
- found[0], found[1],
- found[2])
+ found[0], found[1],
+ found[2])
nextWindow = loaded.__dict__[classNames[step]]
break
except ImportError, e:
rc = ButtonChoiceWindow(self.screen, _("Error!"),
- _("An error occurred when attempting "
- "to load an pomona interface "
- "component.\n\nclassName = %s\n\n"
- "Error: %s")
- % (classNames[step],e),
- buttons=[_("Exit"), _("Retry")])
+ _("An error occurred when attempting "
+ "to load an pomona interface "
+ "component.\n\nclassName = %s\n\n"
+ "Error: %s")
+ % (classNames[step],e),
+ buttons=[_("Exit"), _("Retry")])
if rc == string.lower(_("Exit")):
sys.exit(0)
if step == -1:
if not pomona.dispatch.canGoBack():
ButtonChoiceWindow(self.screen, _("Cancelled"),
- _("I can't go to the previous step "
- "from here. You will have to try "
- "again."),
- buttons=[_("OK")])
+ _("I can't go to the previous step "
+ "from here. You will have to try "
+ "again."),
+ buttons=[_("OK")])
pomona.dispatch.gotoPrev()
else:
pomona.dispatch.gotoNext()
if not f:
ButtonChoiceWindow(screen, _("Help not available"),
- _("No help is available for this "
- "step of the install."),
- buttons=[TEXT_OK_BUTTON])
+ _("No help is available for this "
+ "step of the install."),
+ buttons=[TEXT_OK_BUTTON])
return None
lines = f.readlines()
return exnWin
def messageWindow(self, title, text, type="ok", default = None,
- custom_icon=None, custom_buttons=[]):
+ custom_icon=None, custom_buttons=[]):
if type == "ok":
ButtonChoiceWindow(self.screen, title, text,
- buttons=[TEXT_OK_BUTTON])
+ buttons=[TEXT_OK_BUTTON])
elif type == "yesno":
if default and default == "no":
btnlist = [TEXT_NO_BUTTON, TEXT_YES_BUTTON]
rc = None
while not buttonToAction.has_key(rc):
rc = ButtonChoiceWindow(self.screen, exc.type_string, exc.message,
- buttons=buttons)
+ buttons=buttons)
return buttonToAction[rc]
buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON])
grid = GridFormHelp(screen, _("Boot Loader Configuration"),
- "btloadinstall", 1, 5)
+ "btloadinstall", 1, 5)
grid.add(t, 0, 0, (0,0,0,1))
grid.add(grub, 0, 1, (0,0,0,0))
grid.add(skipbl, 0, 3, (0,0,0,1))
if blradio.getSelection() == "nobl":
rc = ButtonChoiceWindow(screen, _("Skip Boot Loader"),
_("You have elected not to install "
- "any boot loader, which is not recommended "
- "unless you have an advanced need. Booting "
- "your system into Linux directly from the "
- "hard drive almost always requires a boot "
- "loader.\n\n"
- "Are you sure you want to skip boot loader "
- "installation?"),
+ "any boot loader, which is not recommended "
+ "unless you have an advanced need. Booting "
+ "your system into Linux directly from the "
+ "hard drive almost always requires a boot "
+ "loader.\n\n"
+ "Are you sure you want to skip boot loader "
+ "installation?"),
[ (_("Yes"), "yes"), (_("No"), "no") ], width = 50)
if rc == "no":
continue
return INSTALL_NOOP
t = TextboxReflowed(53, _("A few systems need to pass special options "
- "to the kernel at boot time to function "
- "properly. If you need to pass boot options to the "
- "kernel, enter them now. If you don't need any or "
- "aren't sure, leave this blank."))
+ "to the kernel at boot time to function "
+ "properly. If you need to pass boot options to the "
+ "kernel, enter them now. If you don't need any or "
+ "aren't sure, leave this blank."))
entry = Entry(48, scroll = 1, returnExit = 1)
entry.set(pomona.id.bootloader.args.get())
if cb.selected() and not pomona.id.bootloader.forceLBA32:
rc = pomona.intf.messageWindow(_("Warning"),
- _("If LBA32 is not supported by your system's BIOS, "
- "forcing its use can prevent your machine from "
- "booting.\n\n"
- "Would you like to continue and force LBA32 mode?"),
- type = "yesno")
+ _("If LBA32 is not supported by your system's BIOS, "
+ "forcing its use can prevent your machine from "
+ "booting.\n\n"
+ "Would you like to continue and force LBA32 mode?"),
+ type = "yesno")
if rc != 1:
continue
devices.append(device)
(rc, sel) = ListboxChoiceWindow (screen, _("Boot Loader Configuration"),
- _("Where do you want to install the boot loader?"),
- locations, default = default,
- buttons = [ TEXT_OK_BUTTON, TEXT_BACK_BUTTON ],
- help = "bootloaderlocation")
+ _("Where do you want to install the boot loader?"),
+ locations, default = default,
+ buttons = [ TEXT_OK_BUTTON, TEXT_BACK_BUTTON ],
+ help = "bootloaderlocation")
if rc == TEXT_BACK_CHECK:
return INSTALL_BACK
newLabel = Entry (20, scroll = 1, returnExit = 1, text = itemLabel)
buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Clear"), "clear"),
- (_("Cancel"), "cancel")])
+ (_("Cancel"), "cancel")])
subgrid = Grid(2, 2)
subgrid.setField(devLabel, 0, 0, anchorLeft = 1)
elif (result == TEXT_OK_CHECK or result == TEXT_F12_CHECK or result == newLabel):
if not allowNone and not newLabel.value():
ButtonChoiceWindow(screen, _("Invalid Boot Label"),
- _("Boot label may not be empty."),
- [ TEXT_OK_BUTTON ])
+ _("Boot label may not be empty."),
+ [ TEXT_OK_BUTTON ])
result = ""
elif not self.validBootloaderLabel(newLabel.value()):
ButtonChoiceWindow(screen, _("Invalid Boot Label"),
- _("Boot label contains "
- "illegal characters."),
- [ TEXT_OK_BUTTON ])
+ _("Boot label contains "
+ "illegal characters."),
+ [ TEXT_OK_BUTTON ])
result = ""
screen.popWindow()
images = self.bl.images.getImages()
default = self.bl.images.getDefault()
- listboxLabel = Label( "%-7s %-25s %-12s" %
- ( _("Default"), _("Boot label"), _("Device")))
+ listboxLabel = Label("%-7s %-25s %-12s" %
+ (_("Default"), _("Boot label"), _("Device")))
listbox = Listbox(5, scroll = 1, returnExit = 1)
sortedKeys = images.keys()
buttons = ButtonBar(screen, [ TEXT_OK_BUTTON, (_("Edit"), "edit"),
TEXT_BACK_BUTTON ])
- text = TextboxReflowed(55,
- _("The boot manager %s uses can boot other "
- "operating systems as well. Please tell me "
- "what partitions you would like to be able to boot "
- "and what label you want to use for each of them.") % (name,))
+ text = TextboxReflowed(55, _("The boot manager %s uses can boot other "
+ "operating systems as well. Please tell me "
+ "what partitions you would like to be able to boot "
+ "and what label you want to use for each of them.") % (name,))
g = GridFormHelp(screen, _("Boot Loader Configuration"),
- "bootloaderlabels", 1, 4)
+ "bootloaderlabels", 1, 4)
g.add(text, 0, 0, anchorLeft = 1)
g.add(listboxLabel, 0, 1, padding = (0, 1, 0, 0), anchorLeft = 1)
g.add(listbox, 0, 2, padding = (0, 0, 0, 1), anchorLeft = 1)
default = ""
else:
pomona.intf.messageWindow(_("Cannot Delete"),
- _("This boot target cannot be "
- "deleted because it is for "
- "the %s system you are about "
- "to install.") %(name,))
-
+ _("This boot target cannot be "
+ "deleted because it is for "
+ "the %s system you are about "
+ "to install.") %(name,))
screen.popHelpLine()
screen.popWindow()
buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON])
- text = TextboxReflowed(55,
- _("A boot loader password prevents users from passing arbitrary "
- "options to the kernel. For highest security, you "
- "should set a password, but a password is not "
- "necessary for more casual users."))
+ text = TextboxReflowed(55, _("A boot loader password prevents users from passing arbitrary "
+ "options to the kernel. For highest security, you "
+ "should set a password, but a password is not "
+ "necessary for more casual users."))
g = GridFormHelp(screen, _("Boot Loader Configuration"), "grubpasswd", 1, 6)
g.add(text, 0, 0, (0,0,0,1), anchorLeft = 1)
if pw != confirm:
pomona.intf.messageWindow(_("Passwords Do Not Match"),
- _("Passwords do not match"))
+ _("Passwords do not match"))
continue
if len(pw) < 1:
pomona.intf.messageWindow(_("Password Too Short"),
- _("Boot loader password is too short"))
+ _("Boot loader password is too short"))
continue
if len(pw) < 6:
rc = pomona.intf.messageWindow(_("Warning"),
- _("Your boot loader password is shorter than "
- "six characters. We recommend a longer "
- "boot loader password."
- "\n\n"
- "Would you like to continue with this "
- "password?"),
- type = "yesno")
+ _("Your boot loader password is shorter than "
+ "six characters. We recommend a longer "
+ "boot loader password."
+ "\n\n"
+ "Would you like to continue with this "
+ "password?"),
+ type = "yesno")
if rc == 0:
continue
screen.pushHelpLine(string.center(bottomstr, screen.width))
txt = _("Congratulations, your %s installation is "
- "complete.\n\n"
- "%s%s") %(name, floppystr, bootstr)
+ "complete.\n\n"
+ "%s%s") %(name, floppystr, bootstr)
foo = _("For information on errata (updates and bug fixes), visit "
- "%s.\n\n"
- "Information on using your "
- "system is available in the %s wiki at "
- "%s.") %(bugurl, name, wikiurl,)
+ "%s.\n\n"
+ "Information on using your "
+ "system is available in the %s wiki at "
+ "%s.") %(bugurl, name, wikiurl,)
rc = ButtonChoiceWindow(screen, _("Complete"), txt,
- [ _("Reboot") ], help = "finished", width=60)
+ [ _("Reboot") ], help = "finished", width=60)
return INSTALL_OK
class BeginInstallWindow:
def __call__ (self, screen, pomona):
rc = ButtonChoiceWindow(screen, _("Installation to begin"),
- _("Now, we got all information we need for "
- "installation. If there is something you "
- "want change you can still go back. "
- "If not choose OK to start."),
- buttons = [ _("OK"), _("Back") ],
- help = "begininstall")
+ _("Now, we got all information we need for "
+ "installation. If there is something you "
+ "want change you can still go back. "
+ "If not choose OK to start."),
+ buttons = [ _("OK"), _("Back") ],
+ help = "begininstall")
if rc == string.lower(_("Back")):
return INSTALL_BACK
if rc == 0:
rc2 = pomona.intf.messageWindow(_("Reboot?"),
- _("The system will be rebooted now."),
- type="custom", custom_icon="warning",
- custom_buttons=[_("_Back"), _("_Reboot")])
+ _("The system will be rebooted now."),
+ type="custom", custom_icon="warning",
+ custom_buttons=[_("_Back"), _("_Reboot")])
if rc2 == 1:
sys.exit(0)
else:
(button, choice) = \
ListboxChoiceWindow(screen, _("Keyboard Selection"),
- _("Which model keyboard is attached to this computer?"), keyboards,
+ _("Which model keyboard is attached to this computer?"), keyboards,
buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON], width = 30, scroll = 1, height = 8,
default = default, help = "kybd")
if part.type & parted.PARTITION_EXTENDED:
if extendedParent:
raise RuntimeError, ("can't handle more than"
- "one extended partition per disk")
+ "one extended partition per disk")
extendedParent = part.num
indent = 2 * " "
elif part.type & parted.PARTITION_LOGICAL:
if not extendedParent:
raise RuntimeError("crossed logical partition "
- "before extended")
+ "before extended")
indent = 4 * " "
else:
indent = 2 * " "
if part.type & parted.PARTITION_FREESPACE:
self.lb.append(["%s%s" %(indent, _("Free space")),
- "%d" %(start),
- "%d" %(end),
- "%dM" %(size),
- "%s" %(ptype),
- ""], part,
- [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT])
+ "%d" %(start),
+ "%d" %(end),
+ "%dM" %(size),
+ "%s" %(ptype),
+ ""], part,
+ [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT])
else:
dev = devify(get_partition_name(part))
if dev.startswith("/dev/"):
dev = dev[5:]
self.lb.append(["%s%s" %(indent, dev),
- "%d" %(start),
- "%d" %(end),
- "%dM" %(size),
- "%s" %(ptype),
- "%s" %(mount)], part,
- [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT])
+ "%d" %(start),
+ "%d" %(end),
+ "%dM" %(size),
+ "%s" %(ptype),
+ "%s" %(mount)], part,
+ [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT])
part = disk.next_partition(part)
def refresh(self):
log.error("Failed to restore original info")
self.intf.messageWindow(_("Error Partitioning"),
- _("Could not allocate requested partitions: %s.")
- % (msg))
+ _("Could not allocate requested partitions: %s.")
+ % (msg))
rc = -1
except PartitioningWarning, msg:
rc = ButtonChoiceWindow(self.screen, _("Warning"), _("Warning: %s") %(msg),
return (mount, mountgrid)
# make the list of available filesystems and its label
- def makeFsList(self, request, usecallback=1, uselabel=1, usetypes=None,
- ignorefs = None):
+ def makeFsList(self, request, usecallback=1, uselabel=1, usetypes=None, ignorefs = None):
subgrid = Grid(1, 2)
row = 0
# filesystem type selection
badblocksCB.setFlags(FLAG_DISABLED, flag)
poplevel = GridFormHelp(self.screen, _("File System Options"),
- "fsoption", 1, 6)
+ "fsoption", 1, 6)
row = 0
poplevel.add(TextboxReflowed(40, _("Please choose how you would "
- "like to prepare the file system "
- "on this partition.")), 0, 0)
+ "like to prepare the file system "
+ "on this partition.")), 0, 0)
row = row + 1
subgrid = Grid(2, 5)
srow = 0
badblocksCB = None
noformatrb = SingleRadioButton(_("Leave unchanged (preserve data)"),
- None, not format and not migrate)
+ None, not format and not migrate)
subgrid.setField(noformatrb, 0, srow, (0,0,0,1),anchorLeft = 1)
srow = srow + 1
migtypes = origrequest.origfstype.getMigratableFSTargets()
(migtype, miggrid) = self.makeFsList(origrequest, usecallback = 0,
- uselabel = 0, usetypes = migtypes)
+ uselabel = 0, usetypes = migtypes)
if newfstype and newfstype.getName() in migtypes:
migtype.setCurrent(newfstype)
popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON, TEXT_CANCEL_BUTTON))
else:
popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON,
- (_("File System Options"), "fsopts"),
- TEXT_CANCEL_BUTTON))
+ (_("File System Options"), "fsopts"),
+ TEXT_CANCEL_BUTTON))
poplevel.add(popbb, 0, row, (0,1,0,0), growx = 1)
while 1:
if origrequest.start == None:
if invalidInteger(size.value()):
self.intf.messageWindow(_("Invalid Entry for Partition Size"),
- invalidInteger(size.value()))
+ invalidInteger(size.value()))
continue
request.size = int(size.value())
else:
if invalidInteger(start.value()):
self.intf.messageWindow(_("Invalid Entry for Starting Cylinder"),
- invalidInteger(start.value()))
+ invalidInteger(start.value()))
continue
request.start = int(start.value())
if cyltype == "end":
if invalidInteger(end.value()):
self.intf.messageWindow(_("Invalid Entry for End Cylinder"),
- invalidInteger(end.value()))
+ invalidInteger(end.value()))
continue
request.end = int(end.value())
elif cyltype == "size":
if invalidInteger(size.value()):
self.intf.messageWindow(_("Invalid Entry for Partition Size"),
- invalidInteger(size.value()))
+ invalidInteger(size.value()))
continue
request.end = None
request.size = int(size.value())
self.g = GridFormHelp(screen, _("Partitioning"), "partition", 1, 5)
self.lb = CListbox(height=10, cols=6,
- col_widths=[17,6,6,7,10,12],
- scroll=1, returnExit = 1,
- width=70, col_pad=2,
- col_labels=[_('Device'), _('Start'), _('End'), _('Size'), _('Type'), _('Mount Point')],
- col_label_align=[CENTER, CENTER,CENTER,CENTER,CENTER,CENTER])
+ col_widths=[17,6,6,7,10,12],
+ scroll=1, returnExit = 1,
+ width=70, col_pad=2,
+ col_labels=[_('Device'), _('Start'), _('End'), _('Size'), _('Type'), _('Mount Point')],
+ col_label_align=[CENTER, CENTER,CENTER,CENTER,CENTER,CENTER])
self.g.add(self.lb, 0, 1)
self.bb = ButtonBar (screen, ((_("New"), "new", "F2"),
- (_("Edit"), "edit", "F3"),
- (_("Delete"), "delete", "F4"),
- TEXT_OK_BUTTON, TEXT_BACK_BUTTON))
+ (_("Edit"), "edit", "F3"),
+ (_("Delete"), "delete", "F4"),
+ TEXT_OK_BUTTON, TEXT_BACK_BUTTON))
screen.pushHelpLine( _(" F1-Help F2-New F3-Edit F4-Delete F5-Reset F12-OK "))
else:
if not self.partitions.getRequestByMountPoint("/"):
self.intf.messageWindow(_("No Root Partition"),
- _("Installation requires a / partition."))
+ _("Installation requires a / partition."))
continue
(errors, warnings) = self.partitions.sanityCheckAllRequests(self.diskset)
g = GridFormHelp(screen, _("Partitioning Type"), "autopart", 1, 6)
txt = TextboxReflowed(65, _("Installation requires partitioning "
- "of your hard drive. The default "
- "layout is reasonable for most "
- "users. You can either choose "
- "to use this or create your own."))
+ "of your hard drive. The default "
+ "layout is reasonable for most "
+ "users. You can either choose "
+ "to use this or create your own."))
g.add(txt, 0, 0, (0, 0, 0, 0))
opts = ((_("Remove all partitions on selected drives and create default layout"), CLEARPART_TYPE_ALL),
- (_("Create custom layout"), -1))
+ (_("Create custom layout"), -1))
typebox = Listbox(height = len(opts), scroll = 0)
for (txt, val) in opts:
typebox.append(txt, val)
# list of drives to select which to clear
subgrid = Grid(1, 2)
subgrid.setField(TextboxReflowed(55, _("Which drive(s) do you want to "
- "use for this installation?")), 0, 0)
+ "use for this installation?")), 0, 0)
drivelist = CheckboxTree(height=2, scroll=1)
subgrid.setField(drivelist, 0, 1)
g.add(subgrid, 0, 2, (0, 1, 0, 0))
if partmethod_ans != -1:
reviewLayout = pomona.intf.messageWindow(_("Review Partition Layout"),
- _("Review and modify partitioning layout?"),
- type = "yesno")
+ _("Review and modify partitioning layout?"),
+ type = "yesno")
if reviewLayout != 1:
pomona.dispatch.skipStep("partition", skip = 1)
class PartitionMethod:
def __call__(self, screen, partitions, instclass):
rc = ButtonChoiceWindow(screen, _("Disk Partitioning Setup"),
- _(PARTMETHOD_TYPE_DESCR_TEXT),
- [ (_("Autopartition"), "auto"),
- (_("Disk Druid"), "ds"), TEXT_BACK_BUTTON ],
- width = 50, help = "parttool")
+ _(PARTMETHOD_TYPE_DESCR_TEXT),
+ [ (_("Autopartition"), "auto"),
+ (_("Disk Druid"), "ds"), TEXT_BACK_BUTTON ],
+ width = 50, help = "parttool")
if rc == TEXT_BACK_CHECK:
return INSTALL_BACK
g = GridFormHelp(screen, _("Source Type"), "source", 1, 6)
txt = TextboxReflowed(65, _("In installation you have to choose "
- "a source for the installation files. "
- "Mostly you will choose the disc here, "
- "but you are also able to install by "
- "HTTP, FTP hard disk or usb-key."))
+ "a source for the installation files. "
+ "Mostly you will choose the disc here, "
+ "but you are also able to install by "
+ "HTTP, FTP hard disk or usb-key."))
g.add(txt, 0, 0, (0, 0, 0, 0))
options = ((_("Install Disc"), SOURCE_CDROM),
- (_("Internet Source"), SOURCE_URL),
- (_("External Drive"), SOURCE_HD))
+ (_("Internet Source"), SOURCE_URL),
+ (_("External Drive"), SOURCE_HD))
typebox = Listbox(height = len(options), scroll = 0)
for (txt, val) in options:
if source_type == SOURCE_CDROM:
if not isys.cdromList():
ButtonChoiceWindow(screen, _("No CDROM found"),
- _("You choosed to install from an installtion disc, "
- "but there was no cdrom drive found on the system. "
- "Please choose another installation method."),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("You choosed to install from an installtion disc, "
+ "but there was no cdrom drive found on the system. "
+ "Please choose another installation method."),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
continue
from image import CdromInstallMethod
toplevel = GridFormHelp(screen, _("Source URL"), "sourceurl", 1, 3)
toplevel.add(TextboxReflowed(37, _("Enter a host you get the files from."
- "You also must enter a path where the "
- "installer finds the files in."))
- , 0, 0, (0, 0, 0, 1))
+ "You also must enter a path where the "
+ "installer finds the files in."))
+ , 0, 0, (0, 0, 0, 1))
host = Entry(24, text = URL_HOST)
path = Entry(24, text = URL_PATH)
if url.scheme not in ("http", "ftp"):
ButtonChoiceWindow(screen, _("Wrong Protocol"),
- _("You entered a protocol that is not supported by Pomona. "
- "There are only http:// and ftp:// available."),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("You entered a protocol that is not supported by Pomona. "
+ "There are only http:// and ftp:// available."),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
elif not url.path.endswith("/"):
ButtonChoiceWindow(screen, _("Syntax Error"),
- _("The path of the URL must end with a /."),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("The path of the URL must end with a /."),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
else:
from urlinstall import urlretrieve
testurl = urljoin(urlunparse(url), INFO_FILE)
urlretrieve(testurl, "/tmp/" + INFO_FILE)
except IOError, e:
ButtonChoiceWindow(screen, _("Error"),
- _("When we tested your given URL there was an error.\n\n%s" % (e,)),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("When we tested your given URL there was an error.\n\n%s" % (e,)),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
continue
break
toplevel = GridFormHelp(screen, _("Root Password"), "rootpw", 1, 3)
toplevel.add(TextboxReflowed(37, _("Pick a root password. You must "
- "type it twice to ensure you know "
- "it and do not make a typing mistake. "
- "Remember that the "
- "root password is a critical part "
- "of system security!")), 0, 0, (0, 0, 0, 1))
+ "type it twice to ensure you know "
+ "it and do not make a typing mistake. "
+ "Remember that the root password is"
+ "a critical part of system "
+ "security!")), 0, 0, (0, 0, 0, 1))
entry1 = Entry(24, password = 1, text = pomona.id.rootPassword["password"])
entry2 = Entry(24, password = 1, text = pomona.id.rootPassword["password"])
if len(entry1.value ()) < 6:
ButtonChoiceWindow(screen, _("Password Length"),
- _("The root password must be at least 6 characters long."),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("The root password must be at least 6 characters long."),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
elif entry1.value() != entry2.value():
ButtonChoiceWindow(screen, _("Password Mismatch"),
- _("The passwords you entered were different. Please try again."),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("The passwords you entered were different. Please try again."),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
elif has_bad_chars(entry1.value()):
ButtonChoiceWindow(screen, _("Error with Password"),
- _("Requested password contains non-ASCII characters, "
- "which are not allowed."),
- buttons = [ TEXT_OK_BUTTON ], width = 50)
+ _("Requested password contains non-ASCII characters, "
+ "which are not allowed."),
+ buttons = [ TEXT_OK_BUTTON ], width = 50)
else:
break
if callback is not None:
callback.callback(CB_START, title=_("Downloading"), text=_("Retrieving %s")
- % os.path.basename(urlparse.urlparse(location).path))
+ % os.path.basename(urlparse.urlparse(location).path))
# if they dont want a status callback just do it in one big swoop
if callback is None:
class UrlInstallMethod(InstallMethod):
def badPackageError(self, pkgname):
return _("The file %s cannot be opened. This is due to a missing "
- "file or perhaps a corrupt package. Please verify your "
- "mirror contains all required packages, and try using a "
- "different one.\n\n"
- "If you reboot, your system will be left in an inconsistent "
- "state that will likely require reinstallation.\n\n") % pkgname
+ "file or perhaps a corrupt package. Please verify your "
+ "mirror contains all required packages, and try using a "
+ "different one.\n\n"
+ "If you reboot, your system will be left in an inconsistent "
+ "state that will likely require reinstallation.\n\n") % pkgname
def getFilename(self, filename, callback=None, destdir=None, retry=1):
if destdir is None:
rc=urlretrieve(fullPath, file, callback=callback)
except IOError, (errnum, msg):
log.critical("IOError %s occurred getting %s: %s"
- % (errnum, fullPath.replace("%", "%%"), str(msg)))
+ % (errnum, fullPath.replace("%", "%%"), str(msg)))
if not retry:
raise FileCopyException
except Exception, e:
log.error("exception in unmountCD: %s" %(e,))
self.messageWindow(_("Error"),
- _("An error occurred unmounting the disc. "
- "Please make sure you're not accessing "
- "%s from the shell on tty2 "
- "and then click OK to retry.")
- % ("/mnt/source",))
+ _("An error occurred unmounting the disc. "
+ "Please make sure you're not accessing "
+ "%s from the shell on tty2 "
+ "and then click OK to retry.")
+ % ("/mnt/source",))
def filesDone(self):
for file in REQUIRED_FILES: