Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315951 Details for
Bug 461357
Code cleanup - tabs vs. spaces
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Cosmetics - replace tabs with spaces
anaconda-cosmetics.patch (text/plain), 375.05 KB, created by
Patryk Zawadzki
on 2008-09-06 13:34:15 UTC
(
hide
)
Description:
Cosmetics - replace tabs with spaces
Filename:
MIME Type:
Creator:
Patryk Zawadzki
Created:
2008-09-06 13:34:15 UTC
Size:
375.05 KB
patch
obsolete
>diff --git a/autopart.py b/autopart.py >index 490ec1f..2320670 100644 >--- a/autopart.py >+++ b/autopart.py >@@ -362,29 +362,29 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): > numLogical = len(partedUtils.get_logical_partitions(disk)) > > # if there is an extended partition add it in >- if disk.extended_partition: >- numPrimary = numPrimary + 1 >- >+ if disk.extended_partition: >+ numPrimary = numPrimary + 1 >+ > maxPrimary = disk.max_primary_partition_count > maxLogical = partedUtils.get_max_logical_partitions(disk) > > for part in free[drive]: >- # if this is a free space outside extended partition >- # make sure we have free primary partition slots >- if not part.type & parted.PARTITION_LOGICAL: >- if numPrimary == maxPrimary: >- continue >+ # if this is a free space outside extended partition >+ # make sure we have free primary partition slots >+ if not part.type & parted.PARTITION_LOGICAL: >+ if numPrimary == maxPrimary: >+ continue > else: > if numLogical == maxLogical: > continue >- >+ > lvmLog.debug( "Trying partition %s" % (printFreespaceitem(part),)) > partSize = partedUtils.getPartSizeMB(part) > # figure out what the request size will be given the > # geometry (#130885) > requestSectors = long((request.requestSize * 1024L * 1024L) / part.disk.dev.sector_size) - 1 > requestSizeMB = long((requestSectors * part.disk.dev.sector_size) / 1024L / 1024L) >- lvmLog.debug("partSize %s request %s" % (partSize, request.requestSize)) >+ lvmLog.debug("partSize %s request %s" % (partSize, request.requestSize)) > if partSize >= requestSizeMB and partSize > largestPart[0]: > if not request.primary or (not part.type & parted.PARTITION_LOGICAL): > largestPart = (partSize, part) >@@ -412,9 +412,9 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): > > startSec = freeStartSec > >- # For alpha reserve space at the begining of disk >- if iutil.isAlpha() and startSec < long((1024L * 1024L)/disk.dev.sector_size): >- startSec = long((2 * 1024L * 1024L)/disk.dev.sector_size) >+ # For alpha reserve space at the begining of disk >+ if iutil.isAlpha() and startSec < long((1024L * 1024L)/disk.dev.sector_size): >+ startSec = long((2 * 1024L * 1024L)/disk.dev.sector_size) > > endSec = startSec + long(((request.requestSize * 1024L * 1024L) / disk.dev.sector_size)) - 1 > >@@ -499,113 +499,113 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): > def growLogicalVolumes(diskset, requests): > > if requests is None or diskset is None: >- return >+ return > > # iterate over each volume group, grow logical volumes in each > for vgreq in requests.requests: >- if vgreq.type != REQUEST_VG: >- continue >+ if vgreq.type != REQUEST_VG: >+ continue > >- lvmLog.info("In growLogicalVolumes, considering VG %s", vgreq) >- lvreqs = requests.getLVMLVForVG(vgreq) >+ lvmLog.info("In growLogicalVolumes, considering VG %s", vgreq) >+ lvreqs = requests.getLVMLVForVG(vgreq) > >- if lvreqs is None or len(lvreqs) < 1: >- lvmLog.info("Apparently it had no logical volume requests, skipping.") >- continue >+ if lvreqs is None or len(lvreqs) < 1: >+ lvmLog.info("Apparently it had no logical volume requests, skipping.") >+ continue > >- # come up with list of logvol that are growable >- growreqs = [] >- for lvreq in lvreqs: >- if lvreq.grow: >- growreqs.append(lvreq) >+ # come up with list of logvol that are growable >+ growreqs = [] >+ for lvreq in lvreqs: >+ if lvreq.grow: >+ growreqs.append(lvreq) > >- # bail if none defined >+ # bail if none defined > if len(growreqs) < 1: >- lvmLog.info("No growable logical volumes defined in VG %s.", vgreq) >- continue >+ lvmLog.info("No growable logical volumes defined in VG %s.", vgreq) >+ continue > >- lvmLog.info("VG %s has these growable logical volumes: %s", vgreq.volumeGroupName, reduce(lambda x,y: x + [y.uniqueID], growreqs, [])) >+ lvmLog.info("VG %s has these growable logical volumes: %s", vgreq.volumeGroupName, reduce(lambda x,y: x + [y.uniqueID], growreqs, [])) > >- # get remaining free space >+ # get remaining free space > if DEBUG_LVM_GROW: >- vgfree = lvm.getVGFreeSpace(vgreq, requests, diskset) >- lvmLog.debug("Free space in VG after initial partition formation = %s", (vgfree,)) >- >- # store size we are starting at >- initsize = {} >- cursize = {} >- for req in growreqs: >- size = req.getActualSize(requests, diskset) >+ vgfree = lvm.getVGFreeSpace(vgreq, requests, diskset) >+ lvmLog.debug("Free space in VG after initial partition formation = %s", (vgfree,)) >+ >+ # store size we are starting at >+ initsize = {} >+ cursize = {} >+ for req in growreqs: >+ size = req.getActualSize(requests, diskset) > size = lvm.clampPVSize(size, vgreq.pesize) >- initsize[req.logicalVolumeName] = size >- cursize[req.logicalVolumeName] = size >+ initsize[req.logicalVolumeName] = size >+ cursize[req.logicalVolumeName] = size > if req.maxSizeMB: > req.maxSizeMB = lvm.clampPVSize(req.maxSizeMB, vgreq.pesize) >- lvmLog.debug("init sizes for %s: %s",req.logicalVolumeName, size) >- >- # now dolly out free space to all growing LVs >- bailcount = 0 >- while 1: >- nochange = 1 >- completed = [] >- for req in growreqs: >- lvmLog.debug("considering %s, start size = %s",req.logicalVolumeName, req.getStartSize()) >- >- # get remaining free space >- vgfree = lvm.getVGFreeSpace(vgreq, requests, diskset) >- >- lvmLog.debug("Free space in VG = %s",vgfree) >- >- # compute fraction of remaining requests this >- # particular request represents >- totsize = 0.0 >- for otherreq in growreqs: >- if otherreq in completed: >- continue >- >- lvmLog.debug("adding in %s %s %s", otherreq.logicalVolumeName, otherreq.getStartSize(), otherreq.maxSizeMB) >- >- size = otherreq.getActualSize(requests, diskset) >- if otherreq.maxSizeMB: >- if size < otherreq.maxSizeMB: >- totsize = totsize + otherreq.getStartSize() >- else: >- lvmLog.debug("%s is now at %s, and passed maxsize of %s", otherreq.logicalVolumeName, size, otherreq.maxSizeMB) >- else: >- totsize = totsize + otherreq.getStartSize() >- >- lvmLog.debug("totsize -> %s",totsize) >+ lvmLog.debug("init sizes for %s: %s",req.logicalVolumeName, size) >+ >+ # now dolly out free space to all growing LVs >+ bailcount = 0 >+ while 1: >+ nochange = 1 >+ completed = [] >+ for req in growreqs: >+ lvmLog.debug("considering %s, start size = %s",req.logicalVolumeName, req.getStartSize()) >+ >+ # get remaining free space >+ vgfree = lvm.getVGFreeSpace(vgreq, requests, diskset) >+ >+ lvmLog.debug("Free space in VG = %s",vgfree) >+ >+ # compute fraction of remaining requests this >+ # particular request represents >+ totsize = 0.0 >+ for otherreq in growreqs: >+ if otherreq in completed: >+ continue >+ >+ lvmLog.debug("adding in %s %s %s", otherreq.logicalVolumeName, otherreq.getStartSize(), otherreq.maxSizeMB) >+ >+ size = otherreq.getActualSize(requests, diskset) >+ if otherreq.maxSizeMB: >+ if size < otherreq.maxSizeMB: >+ totsize = totsize + otherreq.getStartSize() >+ else: >+ lvmLog.debug("%s is now at %s, and passed maxsize of %s", otherreq.logicalVolumeName, size, otherreq.maxSizeMB) >+ else: >+ totsize = totsize + otherreq.getStartSize() >+ >+ lvmLog.debug("totsize -> %s",totsize) > > # if totsize is zero we have no growable reqs left >- if totsize == 0: >- break >- >- fraction = float(req.getStartSize())/float(totsize) >+ if totsize == 0: >+ break >+ >+ fraction = float(req.getStartSize())/float(totsize) > >- newsize = lvm.clampPVSize(vgfree*fraction, vgreq.pesize) >+ newsize = lvm.clampPVSize(vgfree*fraction, vgreq.pesize) > newsize += cursize[req.logicalVolumeName] > >- if req.maxSizeMB: >- newsize = min(newsize, req.maxSizeMB) >- >- req.size = newsize >- if req.size != cursize[req.logicalVolumeName]: >- nochange = 0 >+ if req.maxSizeMB: >+ newsize = min(newsize, req.maxSizeMB) >+ >+ req.size = newsize >+ if req.size != cursize[req.logicalVolumeName]: >+ nochange = 0 > >- cursize[req.logicalVolumeName] = req.size >+ cursize[req.logicalVolumeName] = req.size > >- lvmLog.debug("Name, size, cursize, vgfree, fraction = %s %s %s %s %s", req.logicalVolumeName, req.size, cursize[req.logicalVolumeName], vgfree, fraction) >+ lvmLog.debug("Name, size, cursize, vgfree, fraction = %s %s %s %s %s", req.logicalVolumeName, req.size, cursize[req.logicalVolumeName], vgfree, fraction) > >- completed.append(req) >+ completed.append(req) > >- if nochange: >- lvmLog.info("In growLogicalVolumes, no changes in size so breaking") >- break >+ if nochange: >+ lvmLog.info("In growLogicalVolumes, no changes in size so breaking") >+ break > >- bailcount = bailcount + 1 >- if bailcount > 10: >- lvmLog.info("In growLogicalVolumes, bailing after 10 interations.") >- break >+ bailcount = bailcount + 1 >+ if bailcount > 10: >+ lvmLog.info("In growLogicalVolumes, bailing after 10 interations.") >+ break > > # grow partitions > def growParts(diskset, requests, newParts): >@@ -762,22 +762,22 @@ def growParts(diskset, requests, newParts): > if maxsect > maxUserSize: > maxsect = long(maxUserSize) > imposedMax = 1 >- >- else: >- # XXX HACK enforce silent limit for swap otherwise it >- # can grow up to 2TB! >- if request.fstype.name == "swap": >- (xxxint, tmpint) = iutil.swapSuggestion(quiet=1) >- >- # convert to sectors >- tmpint = tmpint*1024*1024/sector_size >- tmpint = long(tmpint / cylsectors) >- maxsugswap = tmpint * cylsectors >- userstartsize = origSize[request.uniqueID]*1024*1024/sector_size >- if maxsugswap >= userstartsize: >- maxsect = maxsugswap >- imposedMax = 1 >- lvmLog.warning("Enforced max swap size of %s based on suggested max swap", maxsect) >+ >+ else: >+ # XXX HACK enforce silent limit for swap otherwise it >+ # can grow up to 2TB! >+ if request.fstype.name == "swap": >+ (xxxint, tmpint) = iutil.swapSuggestion(quiet=1) >+ >+ # convert to sectors >+ tmpint = tmpint*1024*1024/sector_size >+ tmpint = long(tmpint / cylsectors) >+ maxsugswap = tmpint * cylsectors >+ userstartsize = origSize[request.uniqueID]*1024*1024/sector_size >+ if maxsugswap >= userstartsize: >+ maxsect = maxsugswap >+ imposedMax = 1 >+ lvmLog.warning("Enforced max swap size of %s based on suggested max swap", maxsect) > > > # round max fs limit down a cylinder, helps when growing >@@ -813,7 +813,7 @@ def growParts(diskset, requests, newParts): > ## 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 >@@ -1019,10 +1019,10 @@ def processPartitioning(diskset, requests, newParts): > elif request.type == REQUEST_VG: > request.size = request.getActualSize(requests, diskset) > elif request.type == REQUEST_LV: >- if request.grow: >- request.setSize(request.getStartSize()) >- else: >- request.size = request.getActualSize(requests, diskset) >+ if request.grow: >+ request.setSize(request.getStartSize()) >+ else: >+ request.size = request.getActualSize(requests, diskset) > elif request.preexist: > # we need to keep track of the max size of preexisting partitions > # FIXME: we should also get the max size for LVs at some point >@@ -1090,10 +1090,10 @@ def doPartitioning(diskset, requests, doRefresh = 1): > size) > else: > vgused[request.volumeGroup] = size >- >+ > for vg in vgused.keys(): > request = requests.getRequestByID(vg) >- lvmLog.info("Used size vs. available for vg %s: %s %s", request.volumeGroupName, vgused[vg], request.getActualSize(requests, diskset)) >+ lvmLog.info("Used size vs. available for vg %s: %s %s", request.volumeGroupName, vgused[vg], request.getActualSize(requests, diskset)) > if vgused[vg] > request.getActualSize(requests, diskset): > raise PartitioningError, _("Adding this partition would not " > "leave enough disk space for already " >@@ -1238,7 +1238,7 @@ def doAutoPartition(anaconda): > partitions = anaconda.id.partitions > > if anaconda.isKickstart: >- partitions.setProtected(anaconda.dispatch) >+ partitions.setProtected(anaconda.dispatch) > > if anaconda.dir == DISPATCH_BACK: > diskset.refreshDevices() >@@ -1297,7 +1297,7 @@ def doAutoPartition(anaconda): > "for %s.\n\n" > "Press 'OK' to exit the installer.") > % (request.device, request.mountpoint), >- custom_icon='error') >+ custom_icon='error') > sys.exit(0) > > # now go through and set things from the request to the >@@ -1392,7 +1392,7 @@ def doAutoPartition(anaconda): > "Press 'OK' to exit the installer.") > % (request.logicalVolumeName, > request.mountpoint), >- custom_icon='error') >+ custom_icon='error') > sys.exit(0) > > # now go through and set things from the request to the >@@ -1536,7 +1536,7 @@ def doAutoPartition(anaconda): > anaconda.intf.messageWindow(_("Warnings During Automatic Partitioning"), > _("Following warnings occurred during automatic " > "partitioning:\n\n%s") % (msg,), >- custom_icon='warning') >+ custom_icon='warning') > else: > lvmLog.warning(str(msg)) > except PartitioningError, msg: >@@ -1572,18 +1572,18 @@ def doAutoPartition(anaconda): > anaconda.intf.messageWindow(_("Automatic Partitioning Errors"), > _("The following errors occurred with your " > "partitioning:\n\n%s\n\n" >- "This can happen if there is not enough " >- "space on your hard drive(s) for the " >- "installation. %s") >+ "This can happen if there is not enough " >+ "space on your hard drive(s) for the " >+ "installation. %s") > % (errortxt, extra), >- custom_icon='error') >- # >- # XXX if in kickstart we reboot >- # >- if anaconda.isKickstart: >- anaconda.intf.messageWindow(_("Unrecoverable Error"), >- _("Your system will now be rebooted.")) >- sys.exit(0) >+ custom_icon='error') >+ # >+ # XXX if in kickstart we reboot >+ # >+ if anaconda.isKickstart: >+ anaconda.intf.messageWindow(_("Unrecoverable Error"), >+ _("Your system will now be rebooted.")) >+ sys.exit(0) > return DISPATCH_BACK > > def autoCreatePartitionRequests(autoreq): >diff --git a/bootloader.py b/bootloader.py >index 29bb9c2..138af2d 100644 >--- a/bootloader.py >+++ b/bootloader.py >@@ -102,9 +102,9 @@ def bootloaderSetupChoices(anaconda): > > choices = anaconda.id.fsset.bootloaderChoices(anaconda.id.diskset, anaconda.id.bootloader) > if not choices and iutil.getPPCMachine() != "iSeries": >- anaconda.dispatch.skipStep("instbootloader") >+ anaconda.dispatch.skipStep("instbootloader") > else: >- anaconda.dispatch.skipStep("instbootloader", skip = 0) >+ anaconda.dispatch.skipStep("instbootloader", skip = 0) > > anaconda.id.bootloader.images.setup(anaconda.id.diskset, anaconda.id.fsset) > >@@ -176,32 +176,32 @@ def writeBootloader(anaconda): > > for (dev, (label, longlabel, type)) in anaconda.id.bootloader.images.getImages().items(): > if (dev == rootDev) or (rootDev is None and kernelLabel is None): >- kernelLabel = label >+ kernelLabel = label > kernelLongLabel = longlabel >- elif dev == defaultDev: >- otherList = [(label, longlabel, dev)] + otherList >- else: >- otherList.append((label, longlabel, dev)) >+ elif dev == defaultDev: >+ otherList = [(label, longlabel, dev)] + otherList >+ else: >+ otherList.append((label, longlabel, dev)) > > if kernelLabel is None: > log.error("unable to find default image, bailing") >- if not justConfigFile: >- w.pop() >+ if not justConfigFile: >+ w.pop() > return > > plainLabelUsed = 0 > defkern = "kernel" > for (version, arch, nick) in \ > anaconda.backend.kernelVersionList(anaconda.rootPath): >- if plainLabelUsed: >+ if plainLabelUsed: > kernelList.append(("%s-%s" %(kernelLabel, nick), > "%s-%s" %(kernelLongLabel, nick), > version)) >- else: >- kernelList.append((kernelLabel, kernelLongLabel, version)) >+ else: >+ kernelList.append((kernelLabel, kernelLongLabel, version)) > if nick != "base": > defkern = "kernel-%s" %(nick,) >- plainLabelUsed = 1 >+ plainLabelUsed = 1 > > f = open(anaconda.rootPath + "/etc/sysconfig/kernel", "w+") > f.write("# UPDATEDEFAULT specifies if new-kernel-pkg should make\n" >@@ -221,11 +221,11 @@ def writeBootloader(anaconda): > anaconda.id.bootloader.write(anaconda.rootPath, anaconda.id.fsset, anaconda.id.bootloader, > anaconda.id.instLanguage, kernelList, otherList, defaultDev, > justConfigFile, anaconda.intf) >- if not justConfigFile: >- w.pop() >+ if not justConfigFile: >+ w.pop() > except bootloaderInfo.BootyNoKernelWarning: >- if not justConfigFile: >- w.pop() >+ if not justConfigFile: >+ w.pop() > if anaconda.intf: > anaconda.intf.messageWindow(_("Warning"), > _("No kernel packages were installed on your " >diff --git a/cmdline.py b/cmdline.py >index 0aa9802..8d881e8 100644 >--- a/cmdline.py >+++ b/cmdline.py >@@ -144,7 +144,7 @@ class InstallInterface: > time.sleep(1) > > anaconda.dispatch.gotoNext() >- (step, instance) = anaconda.dispatch.currentStep() >+ (step, instance) = anaconda.dispatch.currentStep() > > > class progressDisplay: >diff --git a/dispatch.py b/dispatch.py >index 77eb90a..98ceeda 100644 >--- a/dispatch.py >+++ b/dispatch.py >@@ -58,8 +58,8 @@ log = logging.getLogger("anaconda") > # > # items are one of > # >-# ( name ) >-# ( name, Function ) >+# ( name ) >+# ( name, Function ) > # > # in the second case, the function is called directly from the dispatcher > >@@ -120,11 +120,11 @@ class Dispatcher(object): > > def gotoPrev(self): > self._setDir(DISPATCH_BACK) >- self.moveStep() >+ self.moveStep() > > def gotoNext(self): >- self._setDir(DISPATCH_FORWARD) >- self.moveStep() >+ self._setDir(DISPATCH_FORWARD) >+ self.moveStep() > > def canGoBack(self): > # begin with the step before this one. If all steps are skipped, >@@ -142,41 +142,41 @@ class Dispatcher(object): > if state == 1: > del self.skipSteps[step] > >- stepExists = {} >- for step in installSteps: >- name = step[0] >- if not name in steps: >- self.skipSteps[name] = 1 >+ stepExists = {} >+ for step in installSteps: >+ name = step[0] >+ if not name in steps: >+ self.skipSteps[name] = 1 > >- stepExists[name] = 1 >+ stepExists[name] = 1 > >- for name in steps: >- if not stepExists.has_key(name): >+ for name in steps: >+ if not stepExists.has_key(name): > #XXX: hack for yum support >- #raise KeyError, ("step %s does not exist" % name) >+ #raise KeyError, ("step %s does not exist" % name) > log.warning("step %s does not exist", name) > > def stepInSkipList(self, step): > if type(step) == type(1): > step = installSteps[step][0] >- return self.skipSteps.has_key(step) >+ return self.skipSteps.has_key(step) > > def skipStep(self, stepToSkip, skip = 1, permanent = 0): >- for step in installSteps: >- name = step[0] >- if name == stepToSkip: >- if skip: >+ for step in installSteps: >+ name = step[0] >+ if name == stepToSkip: >+ if skip: > if permanent: > self.skipSteps[name] = 2 > elif not self.skipSteps.has_key(name): > self.skipSteps[name] = 1 >- elif self.skipSteps.has_key(name): >- # if marked as permanent then dont change >- if self.skipSteps[name] != 2: >- del self.skipSteps[name] >- return >+ elif self.skipSteps.has_key(name): >+ # if marked as permanent then dont change >+ if self.skipSteps[name] != 2: >+ del self.skipSteps[name] >+ return > >- #raise KeyError, ("unknown step %s" % stepToSkip) >+ #raise KeyError, ("unknown step %s" % stepToSkip) > log.warning("step %s does not exist", name) > > def stepIsDirect(self, step): >@@ -187,58 +187,58 @@ class Dispatcher(object): > return False > > def moveStep(self): >- if self.step == None: >- self.step = self.firstStep >- else: >- self.step = self.step + self._getDir() >+ if self.step == None: >+ self.step = self.firstStep >+ else: >+ self.step = self.step + self._getDir() > >- if self.step >= len(installSteps): >- return None >+ if self.step >= len(installSteps): >+ return None > > while self.step >= self.firstStep and self.step < len(installSteps) \ > and (self.stepInSkipList(self.step) or self.stepIsDirect(self.step)): > > if self.stepIsDirect(self.step) and not self.stepInSkipList(self.step): >- (stepName, stepFunc) = installSteps[self.step] >+ (stepName, stepFunc) = installSteps[self.step] > log.info("moving (%d) to step %s" %(self._getDir(), stepName)) >- rc = stepFunc(self.anaconda) >+ rc = stepFunc(self.anaconda) > if rc in [DISPATCH_BACK, DISPATCH_FORWARD]: >- self._setDir(rc) >- # if anything else, leave self.dir alone >- >- self.step = self.step + self._getDir() >- if self.step == len(installSteps): >- return None >- >- if (self.step < 0): >- # pick the first step not in the skip list >- self.step = 0 >- while self.skipSteps.has_key(installSteps[self.step][0]): >- self.step = self.step + 1 >- elif self.step >= len(installSteps): >- self.step = len(installSteps) - 1 >- while self.skipSteps.has_key(installSteps[self.step][0]): >- self.step = self.step - 1 >+ self._setDir(rc) >+ # if anything else, leave self.dir alone >+ >+ self.step = self.step + self._getDir() >+ if self.step == len(installSteps): >+ return None >+ >+ if (self.step < 0): >+ # pick the first step not in the skip list >+ self.step = 0 >+ while self.skipSteps.has_key(installSteps[self.step][0]): >+ self.step = self.step + 1 >+ elif self.step >= len(installSteps): >+ self.step = len(installSteps) - 1 >+ while self.skipSteps.has_key(installSteps[self.step][0]): >+ self.step = self.step - 1 > log.info("moving (%d) to step %s" %(self._getDir(), installSteps[self.step][0])) > > def currentStep(self): >- if self.step == None: >- self.gotoNext() >- elif self.step >= len(installSteps): >- return (None, None) >+ if self.step == None: >+ self.gotoNext() >+ elif self.step >= len(installSteps): >+ return (None, None) > >- stepInfo = installSteps[self.step] >- step = stepInfo[0] >+ stepInfo = installSteps[self.step] >+ step = stepInfo[0] > >- return (step, self.anaconda) >+ return (step, self.anaconda) > > def __init__(self, anaconda): > self.anaconda = anaconda >- self.anaconda.dir = DISPATCH_FORWARD >- self.step = None >- self.skipSteps = {} >+ self.anaconda.dir = DISPATCH_FORWARD >+ self.step = None >+ self.skipSteps = {} > >- self.firstStep = 0 >+ self.firstStep = 0 > > def _getDir(self): > return self.anaconda.dir >diff --git a/firewall.py b/firewall.py >index f3e689d..77cae2d 100644 >--- a/firewall.py >+++ b/firewall.py >@@ -32,24 +32,24 @@ log = logging.getLogger("anaconda") > > class Firewall: > def __init__ (self): >- self.enabled = 1 >+ self.enabled = 1 > self.trustdevs = [] >- self.portlist = [] >+ self.portlist = [] > self.servicelist = ["ssh"] > > def writeKS(self, f): >- f.write("firewall") >+ f.write("firewall") > > if self.enabled: >- for arg in self.getArgList(): >- f.write(" " + arg) >- else: >- f.write(" --disabled") >+ for arg in self.getArgList(): >+ f.write(" " + arg) >+ else: >+ f.write(" --disabled") > >- f.write("\n") >+ f.write("\n") > > def getArgList(self): >- args = [] >+ args = [] > > if not self.enabled: > args.append("--disabled") >@@ -58,16 +58,16 @@ class Firewall: > for dev in self.trustdevs: > args = args + [ "--trust=%s" %(dev,) ] > >- for port in self.portlist: >- args = args + [ "--port=%s" %(port,) ] >+ for port in self.portlist: >+ args = args + [ "--port=%s" %(port,) ] > > for service in self.servicelist: > args = args + [ "--service=%s" % (service,) ] > >- return args >+ return args > > def write (self, instPath): >- args = [ "--quiet", "--nostart", "-f" ] + self.getArgList() >+ args = [ "--quiet", "--nostart", "-f" ] + self.getArgList() > > try: > if not flags.test: >diff --git a/flags.py b/flags.py >index 85d0771..7fd94f4 100644 >--- a/flags.py >+++ b/flags.py >@@ -25,16 +25,16 @@ from constants import * > class Flags: > > def __getattr__(self, attr): >- if self.__dict__['flags'].has_key(attr): >- return self.__dict__['flags'][attr] >+ if self.__dict__['flags'].has_key(attr): >+ return self.__dict__['flags'][attr] > >- raise AttributeError, attr >+ raise AttributeError, attr > > def __setattr__(self, attr, val): >- if self.__dict__['flags'].has_key(attr): >- self.__dict__['flags'][attr] = val >- else: >- raise AttributeError, attr >+ if self.__dict__['flags'].has_key(attr): >+ self.__dict__['flags'][attr] = val >+ else: >+ raise AttributeError, attr > > def createCmdlineDict(self): > cmdlineDict = {} >@@ -58,25 +58,25 @@ class Flags: > cmdlineDict[key] = val > > return cmdlineDict >- >+ > def __init__(self): >- self.__dict__['flags'] = {} >- self.__dict__['flags']['test'] = 0 >- self.__dict__['flags']['rootpath'] = 0 >- self.__dict__['flags']['livecdInstall'] = 0 >- self.__dict__['flags']['iscsi'] = 0 >- self.__dict__['flags']['serial'] = 0 >- self.__dict__['flags']['setupFilesystems'] = 1 >- self.__dict__['flags']['autostep'] = 0 >- self.__dict__['flags']['autoscreenshot'] = 0 >- self.__dict__['flags']['usevnc'] = 0 >- self.__dict__['flags']['vncquestion'] = True >+ self.__dict__['flags'] = {} >+ self.__dict__['flags']['test'] = 0 >+ self.__dict__['flags']['rootpath'] = 0 >+ self.__dict__['flags']['livecdInstall'] = 0 >+ self.__dict__['flags']['iscsi'] = 0 >+ self.__dict__['flags']['serial'] = 0 >+ self.__dict__['flags']['setupFilesystems'] = 1 >+ self.__dict__['flags']['autostep'] = 0 >+ self.__dict__['flags']['autoscreenshot'] = 0 >+ self.__dict__['flags']['usevnc'] = 0 >+ self.__dict__['flags']['vncquestion'] = True > self.__dict__['flags']['mpath'] = 1 >- self.__dict__['flags']['dmraid'] = 1 >- self.__dict__['flags']['selinux'] = SELINUX_DEFAULT >+ self.__dict__['flags']['dmraid'] = 1 >+ self.__dict__['flags']['selinux'] = SELINUX_DEFAULT > self.__dict__['flags']['debug'] = 0 >- self.__dict__['flags']['targetarch'] = None >- self.__dict__['flags']['updateRpmPlatform'] = False >+ self.__dict__['flags']['targetarch'] = None >+ self.__dict__['flags']['updateRpmPlatform'] = False > self.__dict__['flags']['cmdline'] = self.createCmdlineDict() > self.__dict__['flags']['useIPv4'] = True > self.__dict__['flags']['useIPv6'] = True >diff --git a/fsset.py b/fsset.py >index 7c3445e..c88a257 100644 >--- a/fsset.py >+++ b/fsset.py >@@ -705,7 +705,7 @@ class ext3FileSystem(extFileSystem): > raise RuntimeError, ("Trying to migrate ext3 to something other " > "than ext4") > >- # This is only needed as long as ext4 is actually "ext4dev" >+ # This is only needed as long as ext4 is actually "ext4dev" > rc = iutil.execWithRedirect("tune2fs", > ["-E", "test_fs", devicePath ], > stdout = "/dev/tty5", >diff --git a/installclass.py b/installclass.py >index c36e9e9..1ee7b90 100644 >--- a/installclass.py >+++ b/installclass.py >@@ -92,50 +92,50 @@ class BaseInstallClass(object): > > def setSteps(self, anaconda): > dispatch = anaconda.dispatch >- dispatch.setStepList( >- "language", >- "keyboard", >- "welcome", >+ dispatch.setStepList( >+ "language", >+ "keyboard", >+ "welcome", > "findrootparts", >- "betanag", >- "installtype", >+ "betanag", >+ "installtype", > "partitionobjinit", > "parttype", > "autopartitionexecute", > "partition", >- "partitiondone", >- "bootloadersetup", >- "bootloader", >- "network", >- "timezone", >- "accounts", >+ "partitiondone", >+ "bootloadersetup", >+ "bootloader", >+ "network", >+ "timezone", >+ "accounts", > "reposetup", > "basepkgsel", >- "tasksel", >- "postselection", >- "confirminstall", >- "install", >- "enablefilesystems", >+ "tasksel", >+ "postselection", >+ "confirminstall", >+ "install", >+ "enablefilesystems", > "migratefilesystems", > "setuptime", > "preinstallconfig", >- "installpackages", >+ "installpackages", > "postinstallconfig", >- "writeconfig", >+ "writeconfig", > "firstboot", >- "instbootloader", >+ "instbootloader", > "dopostaction", > "postscripts", >- "writeksconfig", >+ "writeksconfig", > "writeregkey", > "methodcomplete", > "copylogs", > "setfilecon", >- "complete" >- ) >+ "complete" >+ ) > >- if not BETANAG: >- dispatch.skipStep("betanag", permanent=1) >+ if not BETANAG: >+ dispatch.skipStep("betanag", permanent=1) > > if not iutil.isX86(): > dispatch.skipStep("bootloader", permanent=1) >@@ -177,7 +177,7 @@ class BaseInstallClass(object): > pass > > def setPackageSelection(self, anaconda): >- pass >+ pass > > def setGroupSelection(self, anaconda): > grps = anaconda.backend.getDefaultGroups(anaconda) >@@ -210,11 +210,11 @@ class BaseInstallClass(object): > > > def setInstallData(self, anaconda): >- anaconda.id.reset() >- anaconda.id.instClass = self >+ anaconda.id.reset() >+ anaconda.id.instClass = self > > def __init__(self): >- pass >+ pass > > allClasses = [] > allClasses_hidden = [] >@@ -246,13 +246,13 @@ def availableClasses(showHidden=0): > if allClasses_hidden: return allClasses_hidden > > if os.access("installclasses", os.R_OK): >- path = "installclasses" >+ path = "installclasses" > elif os.access("/tmp/updates/installclasses", os.R_OK): > path = "/tmp/updates/installclasses" > elif os.access("/tmp/product/installclasses", os.R_OK): > path = "/tmp/product/installclasses" > else: >- path = "/usr/lib/anaconda/installclasses" >+ path = "/usr/lib/anaconda/installclasses" > > # append the location of installclasses to the python path so we > # can import them >@@ -262,14 +262,14 @@ def availableClasses(showHidden=0): > done = {} > list = [] > for file in files: >- if file[0] == '.': continue >+ if file[0] == '.': continue > if len (file) < 4: >- continue >- if file[-3:] != ".py" and file[-4:-1] != ".py": >- continue >- mainName = string.split(file, ".")[0] >- if done.has_key(mainName): continue >- done[mainName] = 1 >+ continue >+ if file[-3:] != ".py" and file[-4:-1] != ".py": >+ continue >+ mainName = string.split(file, ".")[0] >+ if done.has_key(mainName): continue >+ done[mainName] = 1 > > try: > found = imputil.imp.find_module(mainName) >@@ -282,12 +282,12 @@ def availableClasses(showHidden=0): > > obj = loaded.InstallClass > >- if obj.__dict__.has_key('sortPriority'): >- sortOrder = obj.sortPriority >- else: >- sortOrder = 0 >+ if obj.__dict__.has_key('sortPriority'): >+ sortOrder = obj.sortPriority >+ else: >+ sortOrder = 0 > >- if obj.__dict__.has_key('arch'): >+ if obj.__dict__.has_key('arch'): > if obj.arch != iutil.getArch(): > obj.hidden = 1 > >@@ -340,5 +340,5 @@ baseclass = getBaseInstallClass() > # we need to be able to differentiate between this and custom > class DefaultInstall(baseclass): > def __init__(self): >- BaseInstallClass.__init__(self) >+ BaseInstallClass.__init__(self) > >diff --git a/installclasses/fedora.py b/installclasses/fedora.py >index bbcff8d..8dae236 100644 >--- a/installclasses/fedora.py >+++ b/installclasses/fedora.py >@@ -58,15 +58,15 @@ class InstallClass(BaseInstallClass): > return {'Installation Repo': uri} > > def setInstallData(self, anaconda): >- BaseInstallClass.setInstallData(self, anaconda) >+ BaseInstallClass.setInstallData(self, anaconda) > > if not anaconda.isKickstart: > BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, > CLEARPART_TYPE_LINUX) > > def setSteps(self, anaconda): >- BaseInstallClass.setSteps(self, anaconda); >- anaconda.dispatch.skipStep("partition") >+ BaseInstallClass.setSteps(self, anaconda); >+ anaconda.dispatch.skipStep("partition") > > def getBackend(self): > if flags.livecdInstall: >@@ -76,4 +76,4 @@ class InstallClass(BaseInstallClass): > return yuminstall.YumBackend > > def __init__(self): >- BaseInstallClass.__init__(self) >+ BaseInstallClass.__init__(self) >diff --git a/installclasses/rhel.py b/installclasses/rhel.py >index 668e9cb..b4bfcf2 100644 >--- a/installclasses/rhel.py >+++ b/installclasses/rhel.py >@@ -85,7 +85,7 @@ class InstallClass(BaseInstallClass): > bugFiler = BugzillaFiler(bugUrl="https://bugzilla.redhat.com/xmlrpc.cgi") > > def setInstallData(self, anaconda): >- BaseInstallClass.setInstallData(self, anaconda) >+ BaseInstallClass.setInstallData(self, anaconda) > if not anaconda.isKickstart: > BaseInstallClass.setDefaultPartitioning(self, > anaconda.id.partitions, >@@ -93,9 +93,9 @@ class InstallClass(BaseInstallClass): > > def setSteps(self, anaconda): > dispatch = anaconda.dispatch >- BaseInstallClass.setSteps(self, dispatch); >- dispatch.skipStep("partition") >- dispatch.skipStep("regkey", skip = 0) >+ BaseInstallClass.setSteps(self, dispatch); >+ dispatch.skipStep("partition") >+ dispatch.skipStep("regkey", skip = 0) > > # for rhel, we're putting the metadata under productpath > def getPackagePaths(self, uri): >@@ -178,7 +178,7 @@ class InstallClass(BaseInstallClass): > return yuminstall.YumBackend > > def __init__(self): >- BaseInstallClass.__init__(self) >+ BaseInstallClass.__init__(self) > > self.repopaths = { "base": "%s" %(productPath,) } > >diff --git a/instdata.py b/instdata.py >index 711145f..e7216e8 100644 >--- a/instdata.py >+++ b/instdata.py >@@ -55,28 +55,28 @@ log = logging.getLogger("anaconda") > class InstallData: > > def reset(self): >- # Reset everything except: >- # >- # - The install language >- # - The keyboard >- >- self.instClass = None >- self.network = network.Network() >- self.iscsi = iscsi.iscsi() >- self.zfcp = zfcp.ZFCP() >- self.firewall = firewall.Firewall() >+ # Reset everything except: >+ # >+ # - The install language >+ # - The keyboard >+ >+ self.instClass = None >+ self.network = network.Network() >+ self.iscsi = iscsi.iscsi() >+ self.zfcp = zfcp.ZFCP() >+ self.firewall = firewall.Firewall() > self.security = security.Security() >- self.timezone = timezone.Timezone() >+ self.timezone = timezone.Timezone() > self.timezone.setTimezoneInfo(self.instLanguage.getDefaultTimeZone()) > self.users = None > self.rootPassword = { "isCrypted": False, "password": "", "lock": False } >- self.auth = "--enableshadow --passalgo=sha512" >- self.desktop = desktop.Desktop() >+ self.auth = "--enableshadow --passalgo=sha512" >+ self.desktop = desktop.Desktop() > self.upgrade = None > if flags.cmdline.has_key("preupgrade"): > self.upgrade = True > # XXX move fsset and/or diskset into Partitions object? >- self.fsset.reset() >+ self.fsset.reset() > self.diskset = partedUtils.DiskSet(self.anaconda) > self.partitions = partitions.Partitions(self.anaconda) > self.bootloader = bootloader.getBootloader() >@@ -106,10 +106,10 @@ class InstallData: > self.partitions.protected = [device] > > def setInstallProgressClass(self, c): >- self.instProgress = c >+ self.instProgress = c > > def setDisplayMode(self, display_mode): >- self.displayMode = display_mode >+ self.displayMode = display_mode > > # expects a Keyboard object > def setKeyboard(self, keyboard): >@@ -214,26 +214,26 @@ class InstallData: > > > def writeKS(self, filename): >- f = open(filename, "w") >+ f = open(filename, "w") > >- f.write("# Kickstart file automatically generated by anaconda.\n\n") >+ f.write("# Kickstart file automatically generated by anaconda.\n\n") > f.write("#version=%s\n" % versionToString(DEVEL)) > >- if self.upgrade: >- f.write("upgrade\n"); >- else: >- f.write("install\n"); >+ if self.upgrade: >+ f.write("upgrade\n"); >+ else: >+ f.write("install\n"); > > if self.instClass.skipkey: > f.write("key --skip\n") > elif self.instClass.installkey: > f.write("key %s\n" %(self.instClass.installkey,)) > >- self.instLanguage.writeKS(f) >+ self.instLanguage.writeKS(f) > if not self.isHeadless: > self.keyboard.writeKS(f) >- self.network.writeKS(f) >- self.zfcp.writeKS(f) >+ self.network.writeKS(f) >+ self.zfcp.writeKS(f) > > if self.rootPassword["isCrypted"]: > args = " --iscrypted %s" % self.rootPassword["password"] >@@ -253,11 +253,11 @@ class InstallData: > f.write(self.ksdata.services.__str__()) > f.write(self.ksdata.reboot.__str__()) > >- self.firewall.writeKS(f) >- if self.auth.strip() != "": >- f.write("authconfig %s\n" % self.auth) >+ self.firewall.writeKS(f) >+ if self.auth.strip() != "": >+ f.write("authconfig %s\n" % self.auth) > self.security.writeKS(f) >- self.timezone.writeKS(f) >+ self.timezone.writeKS(f) > self.bootloader.writeKS(f) > self.partitions.writeKS(f) > >@@ -277,15 +277,15 @@ class InstallData: > def __init__(self, anaconda, extraModules, displayMode, backend = None): > self.displayMode = displayMode > >- self.instLanguage = language.Language(self.displayMode) >- self.keyboard = keyboard.Keyboard() >+ self.instLanguage = language.Language(self.displayMode) >+ self.keyboard = keyboard.Keyboard() > self.backend = backend > self.anaconda = anaconda > > self.monitor = None > self.videocard = None > self.isHeadless = 0 >- self.extraModules = extraModules >- self.fsset = fsset.FileSystemSet() >+ self.extraModules = extraModules >+ self.fsset = fsset.FileSystemSet() > >- self.reset() >+ self.reset() >diff --git a/iutil.py b/iutil.py >index 1982577..ecc37fb 100644 >--- a/iutil.py >+++ b/iutil.py >@@ -183,13 +183,13 @@ def execConsole(): > # @return The size of the directory in kilobytes. > def getDirSize(dir): > def getSubdirSize(dir): >- # returns size in bytes >+ # returns size in bytes > mydev = os.lstat(dir)[stat.ST_DEV] > > dsize = 0 > for f in os.listdir(dir): >- curpath = '%s/%s' % (dir, f) >- sinfo = os.lstat(curpath) >+ curpath = '%s/%s' % (dir, f) >+ sinfo = os.lstat(curpath) > if stat.S_ISDIR(sinfo[stat.ST_MODE]): > if mydev == sinfo[stat.ST_DEV]: > dsize += getSubdirSize(curpath) >@@ -231,8 +231,8 @@ def swapSuggestion(quiet=0): > mem = memInstalled()/1024 > mem = ((mem/16)+1)*16 > if not quiet: >- log.info("Detected %sM of memory", mem) >- >+ log.info("Detected %sM of memory", mem) >+ > if mem <= 256: > minswap = 256 > maxswap = 512 >@@ -245,7 +245,7 @@ def swapSuggestion(quiet=0): > maxswap = 2*mem > > if not quiet: >- log.info("Swap attempt of %sM to %sM", minswap, maxswap) >+ log.info("Swap attempt of %sM to %sM", minswap, maxswap) > > return (minswap, maxswap) > >diff --git a/iw/checklist.py b/iw/checklist.py >index 5af1c17..d6b1aa9 100644 >--- a/iw/checklist.py >+++ b/iw/checklist.py >@@ -39,21 +39,21 @@ class CheckList (gtk.TreeView): > > # XXX need to handle the multicolumn case better still.... > def __init__ (self, columns = 1, custom_store=None): >- if custom_store is None: >- self.store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING) >- else: >- self.store = custom_store >- >+ if custom_store is None: >+ self.store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING) >+ else: >+ self.store = custom_store >+ > gtk.TreeView.__init__ (self, self.store) > > # XXX we only handle two text columns right now > if custom_store is None and columns > 2: > raise RuntimeError, "CheckList supports a maximum of 2 columns" >- >+ > self.columns = columns >- >+ > self.checkboxrenderer = gtk.CellRendererToggle() > column = gtk.TreeViewColumn('', self.checkboxrenderer, active=0) > # column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) >@@ -62,7 +62,7 @@ class CheckList (gtk.TreeView): > self.checkboxrenderer.connect ("toggled", self.toggled_item) > self.append_column(column) > >- self.create_columns(columns) >+ self.create_columns(columns) > > self.set_rules_hint(False) > self.set_headers_visible(False) >diff --git a/iw/congrats_gui.py b/iw/congrats_gui.py >index 66a4540..f4db323 100644 >--- a/iw/congrats_gui.py >+++ b/iw/congrats_gui.py >@@ -28,12 +28,12 @@ import os > import gettext > _ = lambda x: gettext.ldgettext("anaconda", x) > >-class CongratulationWindow (InstallWindow): >+class CongratulationWindow (InstallWindow): > > windowTitle = N_("Congratulations") > > def __init__ (self, ics): >- InstallWindow.__init__(self, ics) >+ InstallWindow.__init__(self, ics) > > ics.setPrevEnabled(False) > >@@ -42,7 +42,7 @@ class CongratulationWindow (InstallWindow): > > # this mucks around a bit, but it's the weird case and it's > # better than adding a lot of complication to the normal >- ics.cw.mainxml.get_widget("nextButton").hide() >+ ics.cw.mainxml.get_widget("nextButton").hide() > if os.path.exists("/dev/live-osimg"): > ics.cw.mainxml.get_widget("closeButton").show() > ics.cw.mainxml.get_widget("closeButton").grab_focus() >@@ -51,8 +51,8 @@ class CongratulationWindow (InstallWindow): > ics.cw.mainxml.get_widget("rebootButton").grab_focus() > > def getNext(self): >- # XXX - copy any screenshots over >- gui.copyScreenshots() >+ # XXX - copy any screenshots over >+ gui.copyScreenshots() > > # CongratulationWindow tag=NA > def getScreen (self, anaconda): >@@ -63,7 +63,7 @@ class CongratulationWindow (InstallWindow): > a = gtk.Alignment () > a.add (pix) > a.set (0.5, 0.5, 1.0, 1.0) >- a.set_size_request(200, -1) >+ a.set_size_request(200, -1) > hbox.pack_start (a, False, False, 36) > > bootstr = "" >@@ -77,7 +77,7 @@ class CongratulationWindow (InstallWindow): > > txt = _("Congratulations, the installation is complete.\n\n" > "%s%s") %(floppystr, bootstr) >- label = gui.WrappingLabel(txt) >+ label = gui.WrappingLabel(txt) > label.set_size_request(250, -1) > > hbox.pack_start (label, True, True) >diff --git a/iw/examine_gui.py b/iw/examine_gui.py >index ca49e3a..d3b8657 100644 >--- a/iw/examine_gui.py >+++ b/iw/examine_gui.py >@@ -32,7 +32,7 @@ _ = lambda x: gettext.ldgettext("anaconda", x) > UPGRADE_STR = "upgrade" > REINSTALL_STR = "reinstall" > >-class UpgradeExamineWindow (InstallWindow): >+class UpgradeExamineWindow (InstallWindow): > > windowTitle = N_("Upgrade Examine") > >@@ -41,7 +41,7 @@ class UpgradeExamineWindow (InstallWindow): > upgrade.setSteps(self.anaconda) > self.anaconda.id.setUpgrade(True) > >- rootfs = self.parts[self.upgradecombo.get_active()] >+ rootfs = self.parts[self.upgradecombo.get_active()] > self.anaconda.id.upgradeRoot = [(rootfs[0], rootfs[1])] > self.anaconda.id.rootParts = self.parts > >@@ -50,116 +50,116 @@ class UpgradeExamineWindow (InstallWindow): > else: > self.anaconda.dispatch.skipStep("installtype", skip = 0) > self.anaconda.id.upgrade = False >- >+ > return None > > def createUpgradeOption(self): >- r = pixmapRadioButtonGroup() >- r.addEntry(REINSTALL_STR, >+ r = pixmapRadioButtonGroup() >+ r.addEntry(REINSTALL_STR, > _("_Install %s") %(productName,), >- pixmap=gui.readImageFromFile("install.png"), >- descr=_("Choose this option to freshly install your system. " "Existing software and data may be overwritten " >- "depending on your configuration choices.")) >+ pixmap=gui.readImageFromFile("install.png"), >+ descr=_("Choose this option to freshly install your system. " "Existing software and data may be overwritten " >+ "depending on your configuration choices.")) > >- r.addEntry(UPGRADE_STR, >+ r.addEntry(UPGRADE_STR, > _("_Upgrade an existing installation"), >- pixmap=gui.readImageFromFile("upgrade.png"), >- descr=_("Choose this option if you would like " >+ pixmap=gui.readImageFromFile("upgrade.png"), >+ descr=_("Choose this option if you would like " > "to upgrade your existing %s system. " > "This option preserves the " > "existing data on your drives.") %(productName,)) > >- return r >+ return r > > def upgradeOptionsSetSensitivity(self, state): >- self.uplabel.set_sensitive(state) >- self.upgradecombo.set_sensitive(state) >+ self.uplabel.set_sensitive(state) >+ self.upgradecombo.set_sensitive(state) > > def optionToggled(self, widget, name): >- if name == UPGRADE_STR: >- self.upgradeOptionsSetSensitivity(widget.get_active()) >- self.doupgrade = widget.get_active() >+ if name == UPGRADE_STR: >+ self.upgradeOptionsSetSensitivity(widget.get_active()) >+ self.doupgrade = widget.get_active() > > #UpgradeExamineWindow tag = "upgrade" > def getScreen (self, anaconda): > self.anaconda = anaconda > >- if self.anaconda.id.upgrade == None: >- # this is the first time we've entered this screen >- self.doupgrade = self.anaconda.dispatch.stepInSkipList("installtype") >- else: >- self.doupgrade = self.anaconda.id.upgrade >+ if self.anaconda.id.upgrade == None: >+ # this is the first time we've entered this screen >+ self.doupgrade = self.anaconda.dispatch.stepInSkipList("installtype") >+ else: >+ self.doupgrade = self.anaconda.id.upgrade > > self.parts = self.anaconda.id.rootParts > > vbox = gtk.VBox (False, 10) >- vbox.set_border_width (8) >+ vbox.set_border_width (8) > >- r = self.createUpgradeOption() >+ r = self.createUpgradeOption() > self.r = r > >- b = self.r.render() >- if self.doupgrade: >- self.r.setCurrent(UPGRADE_STR) >- else: >- self.r.setCurrent(REINSTALL_STR) >+ b = self.r.render() >+ if self.doupgrade: >+ self.r.setCurrent(UPGRADE_STR) >+ else: >+ self.r.setCurrent(REINSTALL_STR) > >- self.r.setToggleCallback(self.optionToggled) >- box = gtk.VBox (False) >+ self.r.setToggleCallback(self.optionToggled) >+ box = gtk.VBox (False) > box.pack_start(b, False) > > vbox.pack_start (box, False) > self.root = self.parts[0] > >- # hack hack hackity hack >- upboxtmp = gtk.VBox(False, 5) >- uplabelstr = _("The following installed system will be upgraded:") >- self.uplabel = gtk.Label(uplabelstr) >- self.uplabel.set_alignment(0.0, 0.0) >+ # hack hack hackity hack >+ upboxtmp = gtk.VBox(False, 5) >+ uplabelstr = _("The following installed system will be upgraded:") >+ self.uplabel = gtk.Label(uplabelstr) >+ self.uplabel.set_alignment(0.0, 0.0) > model = gtk.ListStore(str) >- self.upgradecombo = gtk.ComboBox(model) >+ self.upgradecombo = gtk.ComboBox(model) > > cell = gtk.CellRendererText() > self.upgradecombo.pack_start(cell, True) > self.upgradecombo.set_attributes(cell, markup=0) > >- for (part, filesystem, desc, label) in self.parts: >+ for (part, filesystem, desc, label) in self.parts: > iter = model.append() >- if (desc is None) or len(desc) < 1: >- desc = _("Unknown Linux system") >- if part[:5] != "/dev/": >- devname = "/dev/" + part >- else: >- devname = part >+ if (desc is None) or len(desc) < 1: >+ desc = _("Unknown Linux system") >+ if part[:5] != "/dev/": >+ devname = "/dev/" + part >+ else: >+ devname = part > model[iter][0] = "<small>%s (%s)</small>" %(desc, devname) > >- upboxtmp.pack_start(self.uplabel) >+ upboxtmp.pack_start(self.uplabel) > >- # more indentation >- box1 = gtk.HBox(False) >- crackhbox = gtk.HBox(False) >- crackhbox.set_size_request(35, -1) >- box1.pack_start(crackhbox, False, False) >- box1.pack_start(self.upgradecombo, False, False) >- upboxtmp.pack_start(box1, False, False) >+ # more indentation >+ box1 = gtk.HBox(False) >+ crackhbox = gtk.HBox(False) >+ crackhbox.set_size_request(35, -1) >+ box1.pack_start(crackhbox, False, False) >+ box1.pack_start(self.upgradecombo, False, False) >+ upboxtmp.pack_start(box1, False, False) > >- # hack indent it >- upbox = gtk.HBox(False) >+ # hack indent it >+ upbox = gtk.HBox(False) > >-# upbox.pack_start(upboxtmp, True, True) >- upbox.pack_start(upboxtmp, False, False) >+# upbox.pack_start(upboxtmp, True, True) >+ upbox.pack_start(upboxtmp, False, False) > >- # all done phew >- r.packWidgetInEntry(UPGRADE_STR, upbox) >+ # all done phew >+ r.packWidgetInEntry(UPGRADE_STR, upbox) > >- # set default >- idx = 0 >- for p in self.parts: >- if self.anaconda.id.upgradeRoot[0][0] == p[0]: >- self.upgradecombo.set_active(idx) >- break >- idx = idx + 1 >+ # set default >+ idx = 0 >+ for p in self.parts: >+ if self.anaconda.id.upgradeRoot[0][0] == p[0]: >+ self.upgradecombo.set_active(idx) >+ break >+ idx = idx + 1 > >- self.upgradeOptionsSetSensitivity(self.doupgrade) >+ self.upgradeOptionsSetSensitivity(self.doupgrade) > > return vbox >diff --git a/iw/iw_gui.py b/iw/iw_gui.py >index 6cdeaa9..4d755d3 100644 >--- a/iw/iw_gui.py >+++ b/iw/iw_gui.py >@@ -28,17 +28,17 @@ class InstallWindow: > def __init__ (self,ics): > self.ics = ics > >- if self.windowTitle: >- ics.setTitle (_(self.windowTitle)) >+ if self.windowTitle: >+ ics.setTitle (_(self.windowTitle)) > > def getNext (self): >- return None >+ return None > > def renderCallback(self): >- return None >+ return None > > def getPrev (self): >- return None >+ return None > > def getScreen (self): > pass >diff --git a/iw/language_gui.py b/iw/language_gui.py >index fdb4993..13e7996 100644 >--- a/iw/language_gui.py >+++ b/iw/language_gui.py >@@ -33,23 +33,23 @@ class LanguageWindow (InstallWindow): > windowTitle = N_("Language Selection") > > def __init__ (self, ics): >- InstallWindow.__init__ (self, ics) >+ InstallWindow.__init__ (self, ics) > > def getNext (self): > anaconda = self.ics.getICW().anaconda > > (model, iter) = self.listView.get_selection().get_selected() >- assert iter, "No selection found on language list!" >- choice = self.listStore.get_value(iter, 1) >+ assert iter, "No selection found on language list!" >+ choice = self.listStore.get_value(iter, 1) > self.lang = self.instLang.getNickByName(choice) > > if self.lang in self.instLang.getCurrentLangSearchList(): > return None > >- self.instLang.setRuntimeLanguage(self.lang) >- self.instLang.setDefault(self.lang) >+ self.instLang.setRuntimeLanguage(self.lang) >+ self.instLang.setDefault(self.lang) > anaconda.id.timezone.setTimezoneInfo(anaconda.id.instLanguage.getDefaultTimeZone()) >- self.ics.getICW().setLanguage() >+ self.ics.getICW().setLanguage() > > return None > >@@ -62,7 +62,7 @@ class LanguageWindow (InstallWindow): > path = self.listStore.get_path(iter) > col = self.listView.get_column(0) > self.listView.scroll_to_cell(path, col, True, 0.5, 0.5) >- self.listView.set_cursor(path, col, False) >+ self.listView.set_cursor(path, col, False) > > # LanguageWindow tag="lang" > def getScreen (self, anaconda): >@@ -82,7 +82,7 @@ class LanguageWindow (InstallWindow): > label.set_size_request(350, -1) > hbox.pack_start(label, False) > >- self.instLang = anaconda.id.instLanguage >+ self.instLang = anaconda.id.instLanguage > > self.listStore = gtk.ListStore(gobject.TYPE_STRING, > gobject.TYPE_STRING, >@@ -122,7 +122,7 @@ class LanguageWindow (InstallWindow): > sw.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) > sw.add (self.listView) > >- setupTreeViewFixupIdleHandler(self.listView, self.listStore) >+ setupTreeViewFixupIdleHandler(self.listView, self.listStore) > > mainBox.pack_start (hbox, False, False, 10) > mainBox.pack_start (sw, True, True) >diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py >index 24aab4e..cefa47f 100644 >--- a/iw/lvm_dialog_gui.py >+++ b/iw/lvm_dialog_gui.py >@@ -43,23 +43,23 @@ log = logging.getLogger("anaconda") > class VolumeGroupEditor: > > def numAvailableLVSlots(self): >- return max(0, lvm.MAX_LV_SLOTS - len(self.logvolreqs)) >+ return max(0, lvm.MAX_LV_SLOTS - len(self.logvolreqs)) > > def computeSpaceValues(self, alt_pvlist=None, usepe=None): >- if usepe is None: >+ if usepe is None: > pesize = long(self.peCombo.get_active_value()) >- else: >- pesize = long(usepe) >+ else: >+ pesize = long(usepe) > > if alt_pvlist is None: > pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) > else: > pvlist = alt_pvlist >- tspace = self.computeVGSize(pvlist, pesize) >- uspace = self.computeLVSpaceNeeded(self.logvolreqs) >- fspace = tspace - uspace >+ tspace = self.computeVGSize(pvlist, pesize) >+ uspace = self.computeLVSpaceNeeded(self.logvolreqs) >+ fspace = tspace - uspace > >- return (tspace, uspace, fspace) >+ return (tspace, uspace, fspace) > > def getPVWastedRatio(self, newpe): > """ given a new pe value, return percentage of smallest PV wasted >@@ -68,34 +68,34 @@ class VolumeGroupEditor: > """ > pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) > >- waste = 0.0 >- for id in pvlist: >- pvreq = self.partitions.getRequestByID(id) >- pvsize = pvreq.getActualSize(self.partitions, self.diskset) >- waste = max(waste, (long(pvsize*1024) % newpe)/(pvsize*1024.0)) >+ waste = 0.0 >+ for id in pvlist: >+ pvreq = self.partitions.getRequestByID(id) >+ pvsize = pvreq.getActualSize(self.partitions, self.diskset) >+ waste = max(waste, (long(pvsize*1024) % newpe)/(pvsize*1024.0)) > >- return waste >+ return waste > > def getSmallestPVSize(self): > """ finds the smallest PV and returns its size in MB > """ >- first = 1 >+ first = 1 > pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) >- for id in pvlist: >+ for id in pvlist: > try: > pesize = int(self.peCombo.get_active_value()) > except: > pesize = 32768 >- pvreq = self.partitions.getRequestByID(id) >- pvsize = pvreq.getActualSize(self.partitions, self.diskset) >+ pvreq = self.partitions.getRequestByID(id) >+ pvsize = pvreq.getActualSize(self.partitions, self.diskset) > pvsize = lvm.clampPVSize(pvsize, pesize) - (pesize/1024) >- if first: >- minpvsize = pvsize >- first = 0 >- else: >- minpvsize = min(pvsize, minpvsize) >+ if first: >+ minpvsize = pvsize >+ first = 0 >+ else: >+ minpvsize = min(pvsize, minpvsize) > >- return minpvsize >+ return minpvsize > > > def reclampLV(self, newpe): >@@ -107,17 +107,17 @@ class VolumeGroupEditor: > pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) > availSpaceMB = self.computeVGSize(pvlist, newpe) > >- # see if total space is enough >+ # see if total space is enough > oldused = 0 > used = 0 >- resize = 0 >+ resize = 0 > for lv in self.logvolreqs: > osize = lv.getActualSize(self.partitions, self.diskset, True) > oldused = oldused + osize > nsize = lvm.clampLVSizeRequest(osize, newpe, roundup=1) >- if nsize != osize: >- resize = 1 >- >+ if nsize != osize: >+ resize = 1 >+ > used = used + nsize > > if used > availSpaceMB: >@@ -127,23 +127,23 @@ class VolumeGroupEditor: > "required by the currently defined " > "logical volumes will be increased " > "to more than the available space."), >- custom_icon="error") >+ custom_icon="error") > return 0 > >- if resize: >- rc = self.intf.messageWindow(_("Confirm Physical Extent Change"), >- _("This change in the value of the " >- "physical extent will require the " >- "sizes of the current logical " >- "volume requests to be rounded " >- "up in size to an integer multiple " >- "of the " >- "physical extent.\n\nThis change " >- "will take effect immediately."), >- type="custom", custom_icon="question", >- custom_buttons=["gtk-cancel", _("C_ontinue")]) >- if not rc: >- return 0 >+ if resize: >+ rc = self.intf.messageWindow(_("Confirm Physical Extent Change"), >+ _("This change in the value of the " >+ "physical extent will require the " >+ "sizes of the current logical " >+ "volume requests to be rounded " >+ "up in size to an integer multiple " >+ "of the " >+ "physical extent.\n\nThis change " >+ "will take effect immediately."), >+ type="custom", custom_icon="question", >+ custom_buttons=["gtk-cancel", _("C_ontinue")]) >+ if not rc: >+ return 0 > > for lv in self.logvolreqs: > osize = lv.getActualSize(self.partitions, self.diskset, True) >@@ -162,82 +162,82 @@ class VolumeGroupEditor: > > curval = int(widget.get_active_value()) > lastval = widget.get_data("lastpe") >- lastidx = widget.get_data("lastidx") >+ lastidx = widget.get_data("lastidx") > >- # see if PE is too large compared to smallest PV >- # remember PE is in KB, PV size is in MB >- maxpvsize = self.getSmallestPVSize() >- if curval > maxpvsize * 1024: >+ # see if PE is too large compared to smallest PV >+ # remember PE is in KB, PV size is in MB >+ maxpvsize = self.getSmallestPVSize() >+ if curval > maxpvsize * 1024: > self.intf.messageWindow(_("Not enough space"), > _("The physical extent size cannot be " > "changed because the value selected " >- "(%10.2f MB) is larger than the smallest " >- "physical volume (%10.2f MB) in the " >- "volume group.") % (curval/1024.0, maxpvsize), custom_icon="error") >- widget.set_active(lastidx) >+ "(%10.2f MB) is larger than the smallest " >+ "physical volume (%10.2f MB) in the " >+ "volume group.") % (curval/1024.0, maxpvsize), custom_icon="error") >+ widget.set_active(lastidx) > return 0 > >- # see if new PE will make any PV useless due to overhead >- if lvm.clampPVSize(maxpvsize, curval) * 1024 < curval: >+ # see if new PE will make any PV useless due to overhead >+ if lvm.clampPVSize(maxpvsize, curval) * 1024 < curval: > self.intf.messageWindow(_("Not enough space"), > _("The physical extent size cannot be " > "changed because the value selected " >- "(%10.2f MB) is too large compared " >+ "(%10.2f MB) is too large compared " > "to the size of the " >- "smallest physical volume " >- "(%10.2f MB) in the " >- "volume group.") % (curval/1024.0, >+ "smallest physical volume " >+ "(%10.2f MB) in the " >+ "volume group.") % (curval/1024.0, > maxpvsize), > custom_icon="error") >- widget.set_active(lastidx) >+ widget.set_active(lastidx) > return 0 >- >- >- if self.getPVWastedRatio(curval) > 0.10: >- rc = self.intf.messageWindow(_("Too small"), >- _("This change in the value of the " >- "physical extent will waste " >- "substantial space on one or more " >- "of the physical volumes in the " >- "volume group."), >- type="custom", custom_icon="error", >- custom_buttons=["gtk-cancel", _("C_ontinue")]) >- if not rc: >- widget.set_active(lastidx) >- return 0 >- >- # now see if we need to fixup effect PV and LV sizes based on PE >+ >+ >+ if self.getPVWastedRatio(curval) > 0.10: >+ rc = self.intf.messageWindow(_("Too small"), >+ _("This change in the value of the " >+ "physical extent will waste " >+ "substantial space on one or more " >+ "of the physical volumes in the " >+ "volume group."), >+ type="custom", custom_icon="error", >+ custom_buttons=["gtk-cancel", _("C_ontinue")]) >+ if not rc: >+ widget.set_active(lastidx) >+ return 0 >+ >+ # now see if we need to fixup effect PV and LV sizes based on PE > if curval > lastval: > rc = self.reclampLV(curval) > if not rc: >- widget.set_active(lastidx) >- return 0 >+ widget.set_active(lastidx) >+ return 0 > else: > self.updateLogVolStore() >- else: >- maxlv = lvm.getMaxLVSize(curval) >- for lv in self.logvolreqs: >- lvsize = lv.getActualSize(self.partitions, self.diskset, True) >- if lvsize > maxlv: >- self.intf.messageWindow(_("Not enough space"), >- _("The physical extent size " >- "cannot be changed because the " >- "resulting maximum logical " >- "volume size (%10.2f MB) is " >- "smaller " >- "than one or more of the " >- "currently defined logical " >- "volumes.") % (maxlv,), >- custom_icon="error") >- widget.set_active(lastidx) >- return 0 >+ else: >+ maxlv = lvm.getMaxLVSize(curval) >+ for lv in self.logvolreqs: >+ lvsize = lv.getActualSize(self.partitions, self.diskset, True) >+ if lvsize > maxlv: >+ self.intf.messageWindow(_("Not enough space"), >+ _("The physical extent size " >+ "cannot be changed because the " >+ "resulting maximum logical " >+ "volume size (%10.2f MB) is " >+ "smaller " >+ "than one or more of the " >+ "currently defined logical " >+ "volumes.") % (maxlv,), >+ custom_icon="error") >+ widget.set_active(lastidx) >+ return 0 > > widget.set_data("lastpe", curval) >- widget.set_data("lastidx", widget.get_active()) >+ widget.set_data("lastidx", widget.get_active()) > self.updateAllowedLvmPartitionsList(self.availlvmparts, >- self.partitions, >- self.lvmlist) >- self.updateVGSpaceLabels() >+ self.partitions, >+ self.lvmlist) >+ self.updateVGSpaceLabels() > > def prettyFormatPESize(self, val): > if val < 1024: >@@ -272,115 +272,115 @@ class VolumeGroupEditor: > peCombo.connect("changed", self.peChangeCB) > peCombo.set_data("lastpe", default) > >- return peCombo >+ return peCombo > > def clickCB(self, row, data): >- model = self.lvmlist.get_model() >- pvlist = self.getSelectedPhysicalVolumes(model) >- >- # get the selected row >- iter = model.get_iter((string.atoi(data),)) >- >- # we invert val because we get called before checklist >- # changes the toggle state >- val = not model.get_value(iter, 0) >- partname = model.get_value(iter, 1) >- id = self.partitions.getRequestByDeviceName(partname).uniqueID >- if val: >- pvlist.append(id) >- else: >- pvlist.remove(id) >- >- (availSpaceMB, neededSpaceMB, fspace) = self.computeSpaceValues(alt_pvlist=pvlist) >- if availSpaceMB < neededSpaceMB: >- self.intf.messageWindow(_("Not enough space"), >- _("You cannot remove this physical " >- "volume because otherwise the " >- "volume group will be too small to " >- "hold the currently defined logical " >- "volumes."), custom_icon="error") >- return False >- >- self.updateVGSpaceLabels(alt_pvlist = pvlist) >- return True >- >+ model = self.lvmlist.get_model() >+ pvlist = self.getSelectedPhysicalVolumes(model) >+ >+ # get the selected row >+ iter = model.get_iter((string.atoi(data),)) >+ >+ # we invert val because we get called before checklist >+ # changes the toggle state >+ val = not model.get_value(iter, 0) >+ partname = model.get_value(iter, 1) >+ id = self.partitions.getRequestByDeviceName(partname).uniqueID >+ if val: >+ pvlist.append(id) >+ else: >+ pvlist.remove(id) >+ >+ (availSpaceMB, neededSpaceMB, fspace) = self.computeSpaceValues(alt_pvlist=pvlist) >+ if availSpaceMB < neededSpaceMB: >+ self.intf.messageWindow(_("Not enough space"), >+ _("You cannot remove this physical " >+ "volume because otherwise the " >+ "volume group will be too small to " >+ "hold the currently defined logical " >+ "volumes."), custom_icon="error") >+ return False >+ >+ self.updateVGSpaceLabels(alt_pvlist = pvlist) >+ return True >+ > > def createAllowedLvmPartitionsList(self, alllvmparts, reqlvmpart, partitions, preexist = 0): > >- store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING) >- partlist = WideCheckList(2, store, self.clickCB) >- >- sw = gtk.ScrolledWindow() >- sw.add(partlist) >- sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >- sw.set_shadow_type(gtk.SHADOW_IN) >- >- for part in alllvmparts: >- uid = part[0] >- request = partitions.getRequestByID(uid) >- >- if request.type != REQUEST_RAID: >- partname = "%s" % (request.device,) >- else: >- partname = "md%d" % (request.raidminor,) >- >- size = request.getActualSize (partitions, self.diskset) >- used = part[2] >- >- # clip size to current PE >- pesize = int(self.peCombo.get_active_value()) >- size = lvm.clampPVSize(size, pesize) >- partsize = "%10.2f MB" % size >- if used or not reqlvmpart: >- selected = 1 >- else: >- selected = 0 >+ store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING) >+ partlist = WideCheckList(2, store, self.clickCB) >+ >+ sw = gtk.ScrolledWindow() >+ sw.add(partlist) >+ sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >+ sw.set_shadow_type(gtk.SHADOW_IN) >+ >+ for part in alllvmparts: >+ uid = part[0] >+ request = partitions.getRequestByID(uid) >+ >+ if request.type != REQUEST_RAID: >+ partname = "%s" % (request.device,) >+ else: >+ partname = "md%d" % (request.raidminor,) >+ >+ size = request.getActualSize (partitions, self.diskset) >+ used = part[2] >+ >+ # clip size to current PE >+ pesize = int(self.peCombo.get_active_value()) >+ size = lvm.clampPVSize(size, pesize) >+ partsize = "%10.2f MB" % size >+ if used or not reqlvmpart: >+ selected = 1 >+ else: >+ selected = 0 > > if preexist == 0 or selected == 1: > partlist.append_row((partname, partsize), selected) > >- return (partlist, sw) >+ return (partlist, sw) > > def updateAllowedLvmPartitionsList(self, alllvmparts, partitions, partlist): >- """ update sizes in pv list >- >- alllvmparts - list of pv from partitions.getAvailLVMPartitions >- partitions - object holding all partition requests >- partlist - the checklist containing pv list >- """ >- >- row = 0 >- for part in alllvmparts: >- uid = part[0] >- request = partitions.getRequestByID(uid) >- size = request.getActualSize(partitions, self.diskset) >- >- # clip size to current PE >- pesize = int(self.peCombo.get_active_value()) >- size = lvm.clampPVSize(size, pesize) >- partsize = "%10.2f MB" % size >- >- iter = partlist.store.get_iter((int(row),)) >- partlist.store.set_value(iter, 2, partsize) >- row = row + 1 >- >+ """ update sizes in pv list >+ >+ alllvmparts - list of pv from partitions.getAvailLVMPartitions >+ partitions - object holding all partition requests >+ partlist - the checklist containing pv list >+ """ >+ >+ row = 0 >+ for part in alllvmparts: >+ uid = part[0] >+ request = partitions.getRequestByID(uid) >+ size = request.getActualSize(partitions, self.diskset) >+ >+ # clip size to current PE >+ pesize = int(self.peCombo.get_active_value()) >+ size = lvm.clampPVSize(size, pesize) >+ partsize = "%10.2f MB" % size >+ >+ iter = partlist.store.get_iter((int(row),)) >+ partlist.store.set_value(iter, 2, partsize) >+ row = row + 1 >+ > def getCurrentLogicalVolume(self): >- selection = self.logvollist.get_selection() >- (model, iter) = selection.get_selected() >- return iter >+ selection = self.logvollist.get_selection() >+ (model, iter) = selection.get_selected() >+ return iter > > > def editLogicalVolume(self, logrequest, isNew = 0): >- if isNew: >- tstr = _("Make Logical Volume") >- else: >- try: >- tstr = _("Edit Logical Volume: %s") % (logrequest.logicalVolumeName,) >- except: >- tstr = _("Edit Logical Volume") >- >+ if isNew: >+ tstr = _("Make Logical Volume") >+ else: >+ try: >+ tstr = _("Edit Logical Volume: %s") % (logrequest.logicalVolumeName,) >+ except: >+ tstr = _("Edit Logical Volume") >+ > dialog = gtk.Dialog(tstr, self.parent) > gui.addFrame(dialog) > dialog.add_button('gtk-cancel', 2) >@@ -393,7 +393,7 @@ class VolumeGroupEditor: > row = 0 > > lbl = createAlignedLabel(_("_Mount Point:")) >- maintable.attach(lbl, 0, 1, row,row+1) >+ maintable.attach(lbl, 0, 1, row,row+1) > mountCombo = createMountPointCombo(logrequest, excludeMountPoints=["/boot"]) > lbl.set_mnemonic_widget(mountCombo) > maintable.attach(mountCombo, 1, 2, row, row + 1) >@@ -470,9 +470,9 @@ class VolumeGroupEditor: > maxlabel = createAlignedLabel(_("(Max size is %s MB)") % (maxlv,)) > maintable.attach(maxlabel, 1, 2, row, row + 1) > >- self.fsoptionsDict = {} >- if logrequest.getPreExisting(): >- (row, self.fsoptionsDict) = createPreExistFSOptionSection(logrequest, maintable, row, mountCombo, self.partitions, ignorefs = ["software RAID", "physical volume (LVM)", "vfat"]) >+ self.fsoptionsDict = {} >+ if logrequest.getPreExisting(): >+ (row, self.fsoptionsDict) = createPreExistFSOptionSection(logrequest, maintable, row, mountCombo, self.partitions, ignorefs = ["software RAID", "physical volume (LVM)", "vfat"]) > > # checkbutton for encryption using dm-crypt/LUKS > if not logrequest.getPreExisting(): >@@ -494,11 +494,11 @@ class VolumeGroupEditor: > dialog.vbox.pack_start(maintable) > dialog.show_all() > >- while 1: >- rc = dialog.run() >- if rc == 2: >- dialog.destroy() >- return >+ while 1: >+ rc = dialog.run() >+ if rc == 2: >+ dialog.destroy() >+ return > > if not logrequest or not logrequest.getPreExisting(): > fsystem = newfstypeCombo.get_active_value() >@@ -506,15 +506,15 @@ class VolumeGroupEditor: > migrate = 0 > targetSize = None > else: >- if self.fsoptionsDict.has_key("formatcb"): >+ if self.fsoptionsDict.has_key("formatcb"): > format = self.fsoptionsDict["formatcb"].get_active() > if format: > fsystem = self.fsoptionsDict["fstypeCombo"].get_active_value() > else: > format = 0 > >- if self.fsoptionsDict.has_key("migratecb"): >- migrate = self.fsoptionsDict["migratecb"].get_active() >+ if self.fsoptionsDict.has_key("migratecb"): >+ migrate = self.fsoptionsDict["migratecb"].get_active() > if migrate: > fsystem = self.fsoptionsDict["migfstypeCombo"].get_active_value() > else: >@@ -526,7 +526,7 @@ class VolumeGroupEditor: > targetSize = None > > # set back if we are not formatting or migrating >- origfstype = logrequest.origfstype >+ origfstype = logrequest.origfstype > if not format and not migrate: > fsystem = origfstype > >@@ -549,42 +549,42 @@ class VolumeGroupEditor: > else: > size = logrequest.size > >- # is this an existing logical volume or one we're editting >+ # is this an existing logical volume or one we're editting > if logrequest: > preexist = logrequest.getPreExisting() > else: > preexist = 0 > >- # test mount point >+ # test mount point > # check in pending logical volume requests >- # these may not have been put in master list of requests >- # yet if we have not hit 'OK' for the volume group creation >- if fsystem.isMountable(): >- used = 0 >- if logrequest: >- curmntpt = logrequest.mountpoint >- else: >- curmntpt = None >- >- for lv in self.logvolreqs: >- if curmntpt and lv.mountpoint == curmntpt: >- continue >+ # these may not have been put in master list of requests >+ # yet if we have not hit 'OK' for the volume group creation >+ if fsystem.isMountable(): >+ used = 0 >+ if logrequest: >+ curmntpt = logrequest.mountpoint >+ else: >+ curmntpt = None >+ >+ for lv in self.logvolreqs: >+ if curmntpt and lv.mountpoint == curmntpt: >+ continue > if len(mntpt) == 0: > continue > >- if lv.mountpoint == mntpt: >- used = 1 >- break >+ if lv.mountpoint == mntpt: >+ used = 1 >+ break > >- if used: >- self.intf.messageWindow(_("Mount point in use"), >- _("The mount point \"%s\" is in " >- "use. Please pick another.") % >- (mntpt,), custom_icon="error") >- continue >+ if used: >+ self.intf.messageWindow(_("Mount point in use"), >+ _("The mount point \"%s\" is in " >+ "use. Please pick another.") % >+ (mntpt,), custom_icon="error") >+ continue > >- # check out logical volumne name >- lvname = string.strip(lvnameEntry.get_text()) >+ # check out logical volumne name >+ lvname = string.strip(lvnameEntry.get_text()) > > if not logrequest or not logrequest.getPreExisting(): > err = sanityCheckLogicalVolumeName(lvname) >@@ -592,69 +592,69 @@ class VolumeGroupEditor: > self.intf.messageWindow(_("Illegal Logical Volume Name"),err, custom_icon="error") > continue > >- # is it in use? >- used = 0 >- if logrequest: >- origlvname = logrequest.logicalVolumeName >- else: >- origlvname = None >- >- for lv in self.logvolreqs: >- if origlvname and lv.logicalVolumeName == origlvname: >- continue >- >- if lv.logicalVolumeName == lvname: >- used = 1 >- break >- >- if used: >- self.intf.messageWindow(_("Illegal logical volume name"), >- _("The logical volume name \"%s\" is " >- "already in use. Please pick " >- "another.") % (lvname,), custom_icon="error") >- continue >- >- # create potential request >- request = copy.copy(logrequest) >+ # is it in use? >+ used = 0 >+ if logrequest: >+ origlvname = logrequest.logicalVolumeName >+ else: >+ origlvname = None >+ >+ for lv in self.logvolreqs: >+ if origlvname and lv.logicalVolumeName == origlvname: >+ continue >+ >+ if lv.logicalVolumeName == lvname: >+ used = 1 >+ break >+ >+ if used: >+ self.intf.messageWindow(_("Illegal logical volume name"), >+ _("The logical volume name \"%s\" is " >+ "already in use. Please pick " >+ "another.") % (lvname,), custom_icon="error") >+ continue >+ >+ # create potential request >+ request = copy.copy(logrequest) > request.encryption = copy.deepcopy(logrequest.encryption) >- pesize = int(self.peCombo.get_active_value()) >- size = lvm.clampLVSizeRequest(size, pesize, roundup=1) >- >- # do some final tests >- maxlv = lvm.getMaxLVSize(pesize) >- if size > maxlv: >- self.intf.messageWindow(_("Not enough space"), >- _("The current requested size " >- "(%10.2f MB) is larger than the maximum " >- "logical volume size (%10.2f MB). " >- "To increase this limit you can " >- "create more Physical Volumes from " >+ pesize = int(self.peCombo.get_active_value()) >+ size = lvm.clampLVSizeRequest(size, pesize, roundup=1) >+ >+ # do some final tests >+ maxlv = lvm.getMaxLVSize(pesize) >+ if size > maxlv: >+ self.intf.messageWindow(_("Not enough space"), >+ _("The current requested size " >+ "(%10.2f MB) is larger than the maximum " >+ "logical volume size (%10.2f MB). " >+ "To increase this limit you can " >+ "create more Physical Volumes from " > "unpartitioned disk space and " > "add them to this Volume Group.") >- %(size, maxlv), >+ %(size, maxlv), > custom_icon="error") >- continue >+ continue > >- request.fstype = fsystem >+ request.fstype = fsystem > >- if request.fstype.isMountable(): >- request.mountpoint = mntpt >- else: >- request.mountpoint = None >+ if request.fstype.isMountable(): >+ request.mountpoint = mntpt >+ else: >+ request.mountpoint = None > > request.preexist = preexist >- request.logicalVolumeName = lvname >- request.size = size >+ request.logicalVolumeName = lvname >+ request.size = size > request.format = format > request.migrate = migrate > request.targetSize = targetSize > request.grow = 0 > >- # this is needed to clear out any cached info about the device >- # only a workaround - need to change way this is handled in >- # partRequest.py really. >- request.dev = None >- >+ # this is needed to clear out any cached info about the device >+ # only a workaround - need to change way this is handled in >+ # partRequest.py really. >+ request.dev = None >+ > if self.lukscb and self.lukscb.get_active(): > if request.encryption: > passphrase = request.encryption.passphrase >@@ -684,59 +684,59 @@ class VolumeGroupEditor: > else: > request.encryption = None > >- # make list of original logvol requests so we can skip them >- # in tests below. We check for mount point name conflicts >- # above within the current volume group, so it is not >- # necessary to do now. >- err = request.sanityCheckRequest(self.partitions, skipMntPtExistCheck=1, pesize=pesize) >- if err is None: >- skiplist = [] >- for lv in self.origvolreqs: >- skiplist.append(lv.uniqueID) >- >- err = request.isMountPointInUse(self.partitions, requestSkipList=skiplist) >- >- if err: >- self.intf.messageWindow(_("Error With Request"), >- "%s" % (err), custom_icon="error") >- continue >- >- if (not request.format and >- request.mountpoint and request.formatByDefault()): >- if not queryNoFormatPreExisting(self.intf): >- continue >- >- # see if there is room for request >- (availSpaceMB, neededSpaceMB, fspace) = self.computeSpaceValues(usepe=pesize) >- >- tmplogreqs = [] >- for l in self.logvolreqs: >- if origlvname and l.logicalVolumeName == origlvname: >- continue >- >- tmplogreqs.append(l) >- >- tmplogreqs.append(request) >- neededSpaceMB = self.computeLVSpaceNeeded(tmplogreqs) >- >- if neededSpaceMB > availSpaceMB: >- self.intf.messageWindow(_("Not enough space"), >- _("The logical volumes you have " >- "configured require %d MB, but the " >- "volume group only has %d MB. Please " >- "either make the volume group larger " >- "or make the logical volume(s) smaller.") % (neededSpaceMB, availSpaceMB), custom_icon="error") >- del tmplogreqs >- continue >- >- # everything ok >- break >- >- # now remove the previous request, insert request created above >- if not isNew: >- self.logvolreqs.remove(logrequest) >- iter = self.getCurrentLogicalVolume() >- self.logvolstore.remove(iter) >+ # make list of original logvol requests so we can skip them >+ # in tests below. We check for mount point name conflicts >+ # above within the current volume group, so it is not >+ # necessary to do now. >+ err = request.sanityCheckRequest(self.partitions, skipMntPtExistCheck=1, pesize=pesize) >+ if err is None: >+ skiplist = [] >+ for lv in self.origvolreqs: >+ skiplist.append(lv.uniqueID) >+ >+ err = request.isMountPointInUse(self.partitions, requestSkipList=skiplist) >+ >+ if err: >+ self.intf.messageWindow(_("Error With Request"), >+ "%s" % (err), custom_icon="error") >+ continue >+ >+ if (not request.format and >+ request.mountpoint and request.formatByDefault()): >+ if not queryNoFormatPreExisting(self.intf): >+ continue >+ >+ # see if there is room for request >+ (availSpaceMB, neededSpaceMB, fspace) = self.computeSpaceValues(usepe=pesize) >+ >+ tmplogreqs = [] >+ for l in self.logvolreqs: >+ if origlvname and l.logicalVolumeName == origlvname: >+ continue >+ >+ tmplogreqs.append(l) >+ >+ tmplogreqs.append(request) >+ neededSpaceMB = self.computeLVSpaceNeeded(tmplogreqs) >+ >+ if neededSpaceMB > availSpaceMB: >+ self.intf.messageWindow(_("Not enough space"), >+ _("The logical volumes you have " >+ "configured require %d MB, but the " >+ "volume group only has %d MB. Please " >+ "either make the volume group larger " >+ "or make the logical volume(s) smaller.") % (neededSpaceMB, availSpaceMB), custom_icon="error") >+ del tmplogreqs >+ continue >+ >+ # everything ok >+ break >+ >+ # now remove the previous request, insert request created above >+ if not isNew: >+ self.logvolreqs.remove(logrequest) >+ iter = self.getCurrentLogicalVolume() >+ self.logvolstore.remove(iter) > if request.targetSize is not None: > size = request.targetSize > # adjust the free space in the vg >@@ -745,132 +745,132 @@ class VolumeGroupEditor: > else: > diff = request.targetSize - request.size > self.origvgrequest.free -= diff >- >+ > self.logvolreqs.append(request) > >- iter = self.logvolstore.append() >- self.logvolstore.set_value(iter, 0, lvname) >- if request.fstype and request.fstype.isMountable(): >- self.logvolstore.set_value(iter, 1, mntpt) >- else: >- self.logvolstore.set_value(iter, 1, "N/A") >- >- self.logvolstore.set_value(iter, 2, "%Ld" % (size,)) >+ iter = self.logvolstore.append() >+ self.logvolstore.set_value(iter, 0, lvname) >+ if request.fstype and request.fstype.isMountable(): >+ self.logvolstore.set_value(iter, 1, mntpt) >+ else: >+ self.logvolstore.set_value(iter, 1, "N/A") >+ >+ self.logvolstore.set_value(iter, 2, "%Ld" % (size,)) > >- self.updateVGSpaceLabels() >+ self.updateVGSpaceLabels() > dialog.destroy() >- >+ > def editCurrentLogicalVolume(self): >- iter = self.getCurrentLogicalVolume() >- >- if iter is None: >- return >- >- logvolname = self.logvolstore.get_value(iter, 0) >- logrequest = None >- for lv in self.logvolreqs: >- if lv.logicalVolumeName == logvolname: >- logrequest = lv >- >- if logrequest is None: >- return >- >- self.editLogicalVolume(logrequest) >+ iter = self.getCurrentLogicalVolume() >+ >+ if iter is None: >+ return >+ >+ logvolname = self.logvolstore.get_value(iter, 0) >+ logrequest = None >+ for lv in self.logvolreqs: >+ if lv.logicalVolumeName == logvolname: >+ logrequest = lv >+ >+ if logrequest is None: >+ return >+ >+ self.editLogicalVolume(logrequest) > > def addLogicalVolumeCB(self, widget): >- if self.numAvailableLVSlots() < 1: >- self.intf.messageWindow(_("No free slots"), >- _("You cannot create more than %s logical " >- "volumes per volume group.") % (lvm.MAX_LV_SLOTS,), custom_icon="error") >- return >- >+ if self.numAvailableLVSlots() < 1: >+ self.intf.messageWindow(_("No free slots"), >+ _("You cannot create more than %s logical " >+ "volumes per volume group.") % (lvm.MAX_LV_SLOTS,), custom_icon="error") >+ return >+ > (tspace, uspace, fspace) = self.computeSpaceValues() >- if fspace <= 0: >- self.intf.messageWindow(_("No free space"), >- _("There is no room left in the " >- "volume group to create new logical " >- "volumes. " >- "To add a logical volume you must " >- "reduce the size of one or more of " >- "the currently existing " >- "logical volumes"), custom_icon="error") >- return >- >+ if fspace <= 0: >+ self.intf.messageWindow(_("No free space"), >+ _("There is no room left in the " >+ "volume group to create new logical " >+ "volumes. " >+ "To add a logical volume you must " >+ "reduce the size of one or more of " >+ "the currently existing " >+ "logical volumes"), custom_icon="error") >+ return >+ > request = LogicalVolumeRequestSpec(fileSystemTypeGetDefault(), >- size = fspace) >- self.editLogicalVolume(request, isNew = 1) >- return >+ size = fspace) >+ self.editLogicalVolume(request, isNew = 1) >+ return > > def editLogicalVolumeCB(self, widget): >- self.editCurrentLogicalVolume() >- return >+ self.editCurrentLogicalVolume() >+ return > > def delLogicalVolumeCB(self, widget): >- iter = self.getCurrentLogicalVolume() >- if iter is None: >- return >- >- logvolname = self.logvolstore.get_value(iter, 0) >- if logvolname is None: >- return >- >- rc = self.intf.messageWindow(_("Confirm Delete"), >- _("Are you sure you want to delete the " >- "logical volume \"%s\"?") % (logvolname,), >- type = "custom", custom_buttons=["gtk-cancel", _("_Delete")], custom_icon="warning") >- if not rc: >- return >- >- for lv in self.logvolreqs: >- if lv.logicalVolumeName == logvolname: >- self.logvolreqs.remove(lv) >- >- self.logvolstore.remove(iter) >- >- self.updateVGSpaceLabels() >- return >+ iter = self.getCurrentLogicalVolume() >+ if iter is None: >+ return >+ >+ logvolname = self.logvolstore.get_value(iter, 0) >+ if logvolname is None: >+ return >+ >+ rc = self.intf.messageWindow(_("Confirm Delete"), >+ _("Are you sure you want to delete the " >+ "logical volume \"%s\"?") % (logvolname,), >+ type = "custom", custom_buttons=["gtk-cancel", _("_Delete")], custom_icon="warning") >+ if not rc: >+ return >+ >+ for lv in self.logvolreqs: >+ if lv.logicalVolumeName == logvolname: >+ self.logvolreqs.remove(lv) >+ >+ self.logvolstore.remove(iter) >+ >+ self.updateVGSpaceLabels() >+ return > > def logvolActivateCb(self, view, path, col): >- self.editCurrentLogicalVolume() >+ self.editCurrentLogicalVolume() > > def getSelectedPhysicalVolumes(self, model): >- pv = [] >- next = model.get_iter_first() >- currow = 0 >- while next is not None: >- iter = next >- val = model.get_value(iter, 0) >- partname = model.get_value(iter, 1) >- >- if val: >- pvreq = self.partitions.getRequestByDeviceName(partname) >- id = pvreq.uniqueID >- pv.append(id) >- >- next = model.iter_next(iter) >- currow = currow + 1 >- >- return pv >+ pv = [] >+ next = model.get_iter_first() >+ currow = 0 >+ while next is not None: >+ iter = next >+ val = model.get_value(iter, 0) >+ partname = model.get_value(iter, 1) >+ >+ if val: >+ pvreq = self.partitions.getRequestByDeviceName(partname) >+ id = pvreq.uniqueID >+ pv.append(id) >+ >+ next = model.iter_next(iter) >+ currow = currow + 1 >+ >+ return pv > > def computeVGSize(self, pvlist, curpe): >- availSpaceMB = 0L >- for id in pvlist: >- pvreq = self.partitions.getRequestByID(id) >- pvsize = pvreq.getActualSize(self.partitions, self.diskset) >- pvsize = lvm.clampPVSize(pvsize, curpe) - (curpe/1024) >+ availSpaceMB = 0L >+ for id in pvlist: >+ pvreq = self.partitions.getRequestByID(id) >+ pvsize = pvreq.getActualSize(self.partitions, self.diskset) >+ pvsize = lvm.clampPVSize(pvsize, curpe) - (curpe/1024) > >- # have to clamp pvsize to multiple of PE >- availSpaceMB = availSpaceMB + pvsize >+ # have to clamp pvsize to multiple of PE >+ availSpaceMB = availSpaceMB + pvsize > > log.info("computeVGSize: vgsize is %s" % (availSpaceMB,)) >- return availSpaceMB >+ return availSpaceMB > > def computeLVSpaceNeeded(self, logreqs): >- neededSpaceMB = 0 >- for lv in logreqs: >- neededSpaceMB = neededSpaceMB + lv.getActualSize(self.partitions, self.diskset, True) >+ neededSpaceMB = 0 >+ for lv in logreqs: >+ neededSpaceMB = neededSpaceMB + lv.getActualSize(self.partitions, self.diskset, True) > >- return neededSpaceMB >+ return neededSpaceMB > > def updateLogVolStore(self): > self.logvolstore.clear() >@@ -887,95 +887,95 @@ class VolumeGroupEditor: > self.logvolstore.set_value(iter, 1, mntpt) > else: > self.logvolstore.set_value(iter, 1, "") >- else: >- self.logvolstore.set_value(iter, 1, "N/A") >+ else: >+ self.logvolstore.set_value(iter, 1, "N/A") > > self.logvolstore.set_value(iter, 2, "%Ld" % (size,)) > > def updateVGSpaceLabels(self, alt_pvlist=None): >- if alt_pvlist == None: >- pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) >- else: >- pvlist = alt_pvlist >- >+ if alt_pvlist == None: >+ pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) >+ else: >+ pvlist = alt_pvlist >+ > (tspace, uspace, fspace) = self.computeSpaceValues(alt_pvlist=pvlist) > >- self.totalSpaceLabel.set_text("%10.2f MB" % (tspace,)) >- self.usedSpaceLabel.set_text("%10.2f MB" % (uspace,)) >+ self.totalSpaceLabel.set_text("%10.2f MB" % (tspace,)) >+ self.usedSpaceLabel.set_text("%10.2f MB" % (uspace,)) > >- if tspace > 0: >- usedpercent = (100.0*uspace)/tspace >- else: >- usedpercent = 0.0 >- >- self.usedPercentLabel.set_text("(%4.1f %%)" % (usedpercent,)) >+ if tspace > 0: >+ usedpercent = (100.0*uspace)/tspace >+ else: >+ usedpercent = 0.0 >+ >+ self.usedPercentLabel.set_text("(%4.1f %%)" % (usedpercent,)) > >- self.freeSpaceLabel.set_text("%10.2f MB" % (fspace,)) >- if tspace > 0: >- freepercent = (100.0*fspace)/tspace >- else: >- freepercent = 0.0 >+ self.freeSpaceLabel.set_text("%10.2f MB" % (fspace,)) >+ if tspace > 0: >+ freepercent = (100.0*fspace)/tspace >+ else: >+ freepercent = 0.0 > >- self.freePercentLabel.set_text("(%4.1f %%)" % (freepercent,)) >+ self.freePercentLabel.set_text("(%4.1f %%)" % (freepercent,)) > > # > # run the VG editor we created > # > def run(self): >- if self.dialog is None: >- return None >- >- while 1: >- rc = self.dialog.run() >- >- if rc == 2: >- self.destroy() >- return None >- >- pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) >- pesize = int(self.peCombo.get_active_value()) >- availSpaceMB = self.computeVGSize(pvlist, pesize) >- neededSpaceMB = self.computeLVSpaceNeeded(self.logvolreqs) >- >- if neededSpaceMB > availSpaceMB: >- self.intf.messageWindow(_("Not enough space"), >- _("The logical volumes you have " >- "configured require %d MB, but the " >- "volume group only has %d MB. Please " >- "either make the volume group larger " >- "or make the logical volume(s) smaller.") % (neededSpaceMB, availSpaceMB), custom_icon="error") >- continue >- >- # check volume name >- volname = string.strip(self.volnameEntry.get_text()) >- err = sanityCheckVolumeGroupName(volname) >- if err: >- self.intf.messageWindow(_("Invalid Volume Group Name"), err, >- custom_icon="error") >- continue >- >- if self.origvgrequest: >- origvname = self.origvgrequest.volumeGroupName >- else: >- origname = None >- >- if origvname != volname: >- if self.partitions.isVolumeGroupNameInUse(volname): >- self.intf.messageWindow(_("Name in use"), >- _("The volume group name \"%s\" is " >- "already in use. Please pick " >- "another." % (volname,)), >- custom_icon="error") >- continue >- >- # get physical extent >- pesize = int(self.peCombo.get_active_value()) >- >- # everything ok >- break >- >- request = VolumeGroupRequestSpec(physvols = pvlist, vgname = volname, >- pesize = pesize) >+ if self.dialog is None: >+ return None >+ >+ while 1: >+ rc = self.dialog.run() >+ >+ if rc == 2: >+ self.destroy() >+ return None >+ >+ pvlist = self.getSelectedPhysicalVolumes(self.lvmlist.get_model()) >+ pesize = int(self.peCombo.get_active_value()) >+ availSpaceMB = self.computeVGSize(pvlist, pesize) >+ neededSpaceMB = self.computeLVSpaceNeeded(self.logvolreqs) >+ >+ if neededSpaceMB > availSpaceMB: >+ self.intf.messageWindow(_("Not enough space"), >+ _("The logical volumes you have " >+ "configured require %d MB, but the " >+ "volume group only has %d MB. Please " >+ "either make the volume group larger " >+ "or make the logical volume(s) smaller.") % (neededSpaceMB, availSpaceMB), custom_icon="error") >+ continue >+ >+ # check volume name >+ volname = string.strip(self.volnameEntry.get_text()) >+ err = sanityCheckVolumeGroupName(volname) >+ if err: >+ self.intf.messageWindow(_("Invalid Volume Group Name"), err, >+ custom_icon="error") >+ continue >+ >+ if self.origvgrequest: >+ origvname = self.origvgrequest.volumeGroupName >+ else: >+ origname = None >+ >+ if origvname != volname: >+ if self.partitions.isVolumeGroupNameInUse(volname): >+ self.intf.messageWindow(_("Name in use"), >+ _("The volume group name \"%s\" is " >+ "already in use. Please pick " >+ "another." % (volname,)), >+ custom_icon="error") >+ continue >+ >+ # get physical extent >+ pesize = int(self.peCombo.get_active_value()) >+ >+ # everything ok >+ break >+ >+ request = VolumeGroupRequestSpec(physvols = pvlist, vgname = volname, >+ pesize = pesize) > > # if it was preexisting, it still should be > if self.origvgrequest and self.origvgrequest.getPreExisting(): >@@ -983,47 +983,47 @@ class VolumeGroupEditor: > elif self.origvgrequest: > request.format = self.origvgrequest.format > >- return (request, self.logvolreqs) >+ return (request, self.logvolreqs) > > def destroy(self): >- if self.dialog: >- self.dialog.destroy() >- self.dialog = None >+ if self.dialog: >+ self.dialog.destroy() >+ self.dialog = None > > def __init__(self, partitions, diskset, intf, parent, origvgrequest, isNew = 0): >- self.partitions = partitions >- self.diskset = diskset >- self.origvgrequest = origvgrequest >- self.isNew = isNew >- self.intf = intf >- self.parent = parent >+ self.partitions = partitions >+ self.diskset = diskset >+ self.origvgrequest = origvgrequest >+ self.isNew = isNew >+ self.intf = intf >+ self.parent = parent > > self.availlvmparts = self.partitions.getAvailLVMPartitions(self.origvgrequest, > self.diskset) > self.logvolreqs = self.partitions.getLVMLVForVG(self.origvgrequest) >- self.origvolreqs = copy.copy(self.logvolreqs) >+ self.origvolreqs = copy.copy(self.logvolreqs) > > # if no PV exist, raise an error message and return > if len(self.availlvmparts) < 1: >- self.intf.messageWindow(_("Not enough physical volumes"), >- _("At least one unused physical " >- "volume partition is " >- "needed to create an LVM Volume Group.\n\n" >- "Create a partition or RAID array " >- "of type \"physical volume (LVM)\" and then " >- "select the \"LVM\" option again."), >- custom_icon="error") >- self.dialog = None >+ self.intf.messageWindow(_("Not enough physical volumes"), >+ _("At least one unused physical " >+ "volume partition is " >+ "needed to create an LVM Volume Group.\n\n" >+ "Create a partition or RAID array " >+ "of type \"physical volume (LVM)\" and then " >+ "select the \"LVM\" option again."), >+ custom_icon="error") >+ self.dialog = None > return > >- if isNew: >- tstr = _("Make LVM Volume Group") >- else: >- try: >- tstr = _("Edit LVM Volume Group: %s") % (origvgrequest.volumeGroupName,) >- except: >- tstr = _("Edit LVM Volume Group") >- >+ if isNew: >+ tstr = _("Make LVM Volume Group") >+ else: >+ try: >+ tstr = _("Edit LVM Volume Group: %s") % (origvgrequest.volumeGroupName,) >+ except: >+ tstr = _("Edit LVM Volume Group") >+ > dialog = gtk.Dialog(tstr, self.parent) > gui.addFrame(dialog) > dialog.add_button('gtk-cancel', 2) >@@ -1048,11 +1048,11 @@ class VolumeGroupEditor: > else: > lbl = createAlignedLabel(_("Volume Group Name:")) > self.volnameEntry = gtk.Label(self.origvgrequest.volumeGroupName) >- >- maintable.attach(lbl, 0, 1, row, row + 1, >+ >+ maintable.attach(lbl, 0, 1, row, row + 1, > gtk.EXPAND|gtk.FILL, gtk.SHRINK) > maintable.attach(self.volnameEntry, 1, 2, row, row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- row = row + 1 >+ row = row + 1 > > lbl = createAlignedLabel(_("_Physical Extent:")) > self.peCombo = self.createPEOptionMenu(self.origvgrequest.pesize) >@@ -1076,77 +1076,77 @@ class VolumeGroupEditor: > row = row + 1 > > maintable.attach(createAlignedLabel(_("Used Space:")), 0, 1, row, >- row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- lbox = gtk.HBox() >- self.usedSpaceLabel = gtk.Label("") >- labelalign = gtk.Alignment() >- labelalign.set(1.0, 0.5, 0.0, 0.0) >- labelalign.add(self.usedSpaceLabel) >- lbox.pack_start(labelalign, False, False) >- self.usedPercentLabel = gtk.Label("") >- labelalign = gtk.Alignment() >- labelalign.set(1.0, 0.5, 0.0, 0.0) >- labelalign.add(self.usedPercentLabel) >- lbox.pack_start(labelalign, False, False, padding=10) >+ row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >+ lbox = gtk.HBox() >+ self.usedSpaceLabel = gtk.Label("") >+ labelalign = gtk.Alignment() >+ labelalign.set(1.0, 0.5, 0.0, 0.0) >+ labelalign.add(self.usedSpaceLabel) >+ lbox.pack_start(labelalign, False, False) >+ self.usedPercentLabel = gtk.Label("") >+ labelalign = gtk.Alignment() >+ labelalign.set(1.0, 0.5, 0.0, 0.0) >+ labelalign.add(self.usedPercentLabel) >+ lbox.pack_start(labelalign, False, False, padding=10) > maintable.attach(lbox, 1, 2, row, row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- maintable.set_row_spacing(row, 0) >+ maintable.set_row_spacing(row, 0) > row = row + 1 > > maintable.attach(createAlignedLabel(_("Free Space:")), 0, 1, row, >- row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- lbox = gtk.HBox() >- self.freeSpaceLabel = gtk.Label("") >- labelalign = gtk.Alignment() >- labelalign.set(1.0, 0.5, 0.0, 0.0) >- labelalign.add(self.freeSpaceLabel) >- lbox.pack_start(labelalign, False, False) >- self.freePercentLabel = gtk.Label("") >- labelalign = gtk.Alignment() >- labelalign.set(1.0, 0.5, 0.0, 0.0) >- labelalign.add(self.freePercentLabel) >- lbox.pack_start(labelalign, False, False, padding=10) >+ row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >+ lbox = gtk.HBox() >+ self.freeSpaceLabel = gtk.Label("") >+ labelalign = gtk.Alignment() >+ labelalign.set(1.0, 0.5, 0.0, 0.0) >+ labelalign.add(self.freeSpaceLabel) >+ lbox.pack_start(labelalign, False, False) >+ self.freePercentLabel = gtk.Label("") >+ labelalign = gtk.Alignment() >+ labelalign.set(1.0, 0.5, 0.0, 0.0) >+ labelalign.add(self.freePercentLabel) >+ lbox.pack_start(labelalign, False, False, padding=10) > > maintable.attach(lbox, 1, 2, row, row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- maintable.set_row_spacing(row, 0) >+ maintable.set_row_spacing(row, 0) > row = row + 1 > > maintable.attach(createAlignedLabel(_("Total Space:")), 0, 1, row, >- row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- self.totalSpaceLabel = gtk.Label("") >- labelalign = gtk.Alignment() >- labelalign.set(0.0, 0.5, 0.0, 0.0) >- labelalign.add(self.totalSpaceLabel) >+ row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >+ self.totalSpaceLabel = gtk.Label("") >+ labelalign = gtk.Alignment() >+ labelalign.set(0.0, 0.5, 0.0, 0.0) >+ labelalign.add(self.totalSpaceLabel) > maintable.attach(labelalign, 1, 2, row, row + 1, gtk.EXPAND|gtk.FILL, gtk.SHRINK) >- maintable.set_row_spacing(row, 5) >+ maintable.set_row_spacing(row, 5) > row = row + 1 > >- # populate list of logical volumes >+ # populate list of logical volumes > lvtable = gtk.Table() > lvtable.set_row_spacings(5) > lvtable.set_col_spacings(5) >- self.logvolstore = gtk.ListStore(gobject.TYPE_STRING, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING) >- >- if self.logvolreqs: >- for lvrequest in self.logvolreqs: >- iter = self.logvolstore.append() >- self.logvolstore.set_value(iter, 0, lvrequest.logicalVolumeName) >+ self.logvolstore = gtk.ListStore(gobject.TYPE_STRING, >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING) >+ >+ if self.logvolreqs: >+ for lvrequest in self.logvolreqs: >+ iter = self.logvolstore.append() >+ self.logvolstore.set_value(iter, 0, lvrequest.logicalVolumeName) > if lvrequest.mountpoint is not None: >- self.logvolstore.set_value(iter, 1, lvrequest.mountpoint) >- else: >- self.logvolstore.set_value(iter, 1, "") >- self.logvolstore.set_value(iter, 2, "%Ld" % (lvrequest.getActualSize(self.partitions, self.diskset, True))) >+ self.logvolstore.set_value(iter, 1, lvrequest.mountpoint) >+ else: >+ self.logvolstore.set_value(iter, 1, "") >+ self.logvolstore.set_value(iter, 2, "%Ld" % (lvrequest.getActualSize(self.partitions, self.diskset, True))) > >- self.logvollist = gtk.TreeView(self.logvolstore) >+ self.logvollist = gtk.TreeView(self.logvolstore) > col = gtk.TreeViewColumn(_("Logical Volume Name"), >- gtk.CellRendererText(), text=0) >+ gtk.CellRendererText(), text=0) > self.logvollist.append_column(col) > col = gtk.TreeViewColumn(_("Mount Point"), >- gtk.CellRendererText(), text=1) >+ gtk.CellRendererText(), text=1) > self.logvollist.append_column(col) > col = gtk.TreeViewColumn(_("Size (MB)"), >- gtk.CellRendererText(), text=2) >+ gtk.CellRendererText(), text=2) > self.logvollist.append_column(col) > self.logvollist.connect('row-activated', self.logvolActivateCb) > >@@ -1154,45 +1154,45 @@ class VolumeGroupEditor: > sw.add(self.logvollist) > sw.set_size_request(100, 100) > sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) >- sw.set_shadow_type(gtk.SHADOW_IN) >+ sw.set_shadow_type(gtk.SHADOW_IN) > lvtable.attach(sw, 0, 1, 0, 1) > >- # button box of options >- lvbbox = gtk.VBox() >+ # button box of options >+ lvbbox = gtk.VBox() > add = gtk.Button(_("_Add")) > add.connect("clicked", self.addLogicalVolumeCB) >- lvbbox.pack_start(add) >+ lvbbox.pack_start(add) > edit = gtk.Button(_("_Edit")) > edit.connect("clicked", self.editLogicalVolumeCB) >- lvbbox.pack_start(edit) >+ lvbbox.pack_start(edit) > delete = gtk.Button(_("_Delete")) > delete.connect("clicked", self.delLogicalVolumeCB) >- lvbbox.pack_start(delete) >+ lvbbox.pack_start(delete) > >- lvalign = gtk.Alignment() >- lvalign.set(0.5, 0.0, 0.0, 0.0) >- lvalign.add(lvbbox) >+ lvalign = gtk.Alignment() >+ lvalign.set(0.5, 0.0, 0.0, 0.0) >+ lvalign.add(lvbbox) > lvtable.attach(lvalign, 1, 2, 0, 1, gtk.SHRINK, gtk.SHRINK) > >- # pack all logical volumne stuff in a frame >- lvtable.set_border_width(12) >+ # pack all logical volumne stuff in a frame >+ lvtable.set_border_width(12) > l = gtk.Label() > l.set_markup_with_mnemonic("<b>%s</b>" %(_("_Logical Volumes"),)) > l.set_mnemonic_widget(self.logvollist) >- frame = gtk.Frame() >+ frame = gtk.Frame() > frame.set_label_widget(l) >- frame.add(lvtable) >+ frame.add(lvtable) > frame.set_shadow_type(gtk.SHADOW_NONE) > >-# dialog.vbox.pack_start(frame) >- maintable.attach(frame, 0, 2, row, row+1) >- row = row + 1 >- >+# dialog.vbox.pack_start(frame) >+ maintable.attach(frame, 0, 2, row, row+1) >+ row = row + 1 >+ > dialog.vbox.pack_start(maintable) >- dialog.set_size_request(550, 450) >+ dialog.set_size_request(550, 450) > dialog.show_all() > >- # set space labels to correct values >- self.updateVGSpaceLabels() >+ # set space labels to correct values >+ self.updateVGSpaceLabels() > >- self.dialog = dialog >+ self.dialog = dialog >diff --git a/iw/osbootwidget.py b/iw/osbootwidget.py >index d4a2942..b1a9692 100644 >--- a/iw/osbootwidget.py >+++ b/iw/osbootwidget.py >@@ -49,7 +49,7 @@ class OSBootWidget: > > self.vbox = gtk.VBox(False, 5) > label = gtk.Label("<b>" + _("Boot loader operating system list") + "</b>") >- label.set_alignment(0.0, 0.0) >+ label.set_alignment(0.0, 0.0) > label.set_property("use-markup", True) > self.vbox.pack_start(label, False) > >@@ -135,8 +135,8 @@ class OSBootWidget: > > dialog.vbox.pack_start(gui.WrappingLabel( > _("Enter a label for the boot loader menu to display. The " >- "device (or hard drive and partition number) is the device " >- "from which it boots."))) >+ "device (or hard drive and partition number) is the device " >+ "from which it boots."))) > > table = gtk.Table(2, 5) > table.set_row_spacings(5) >@@ -327,8 +327,8 @@ class OSBootWidget: > else: > self.intf.messageWindow(_("Cannot Delete"), > _("This boot target cannot be deleted " >- "because it is for the %s " >- "system you are about to install.") >+ "because it is for the %s " >+ "system you are about to install.") > %(productName,), > type="warning") > >@@ -366,10 +366,10 @@ class OSBootWidget: > del self.imagelist[dev] > continue > >- isRoot = 0 >- fsentry = self.fsset.getEntryByDeviceName(dev) >- if fsentry and fsentry.getMountPoint() == '/': >- isRoot = 1 >+ isRoot = 0 >+ fsentry = self.fsset.getEntryByDeviceName(dev) >+ if fsentry and fsentry.getMountPoint() == '/': >+ isRoot = 1 > > iter = self.osStore.append() > self.osStore.set_value(iter, 1, theLabel) >diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py >index 7e547cd..b1f1210 100644 >--- a/iw/partition_dialog_gui.py >+++ b/iw/partition_dialog_gui.py >@@ -37,82 +37,82 @@ _ = lambda x: gettext.ldgettext("anaconda", x) > > class PartitionEditor: > def sizespinchangedCB(self, widget, fillmaxszsb): >- size = widget.get_value_as_int() >- maxsize = fillmaxszsb.get_value_as_int() >+ size = widget.get_value_as_int() >+ maxsize = fillmaxszsb.get_value_as_int() > if size < 1: > widget.set_value(1) > size = 1 >- if size > maxsize: >- fillmaxszsb.set_value(size) >+ if size > maxsize: >+ fillmaxszsb.set_value(size) > >- # ugly got to be better way >- adj = fillmaxszsb.get_adjustment() >- adj.clamp_page(size, adj.upper) >- fillmaxszsb.set_adjustment(adj) >+ # ugly got to be better way >+ adj = fillmaxszsb.get_adjustment() >+ adj.clamp_page(size, adj.upper) >+ fillmaxszsb.set_adjustment(adj) > > def cylspinchangedCB(self, widget, data): >- (dev, startcylspin, endcylspin, bycyl_sizelabel) = data >- startsec = start_cyl_to_sector(dev, >- startcylspin.get_value_as_int()) >- endsec = end_cyl_to_sector(dev, endcylspin.get_value_as_int()) >- cursize = (endsec - startsec)/2048 >- bycyl_sizelabel.set_text("%s" % (int(cursize))) >+ (dev, startcylspin, endcylspin, bycyl_sizelabel) = data >+ startsec = start_cyl_to_sector(dev, >+ startcylspin.get_value_as_int()) >+ endsec = end_cyl_to_sector(dev, endcylspin.get_value_as_int()) >+ cursize = (endsec - startsec)/2048 >+ bycyl_sizelabel.set_text("%s" % (int(cursize))) > > def fillmaxszCB(self, widget, spin): >- spin.set_sensitive(widget.get_active()) >+ spin.set_sensitive(widget.get_active()) > > # pass in CB defined above because of two scope limitation of python! > def createSizeOptionsFrame(self, request, fillmaxszCB): >- frame = gtk.Frame(_("Additional Size Options")) >- sizeoptiontable = gtk.Table() >- sizeoptiontable.set_row_spacings(5) >- sizeoptiontable.set_border_width(4) >- >- fixedrb = gtk.RadioButton(label=_("_Fixed size")) >- fillmaxszrb = gtk.RadioButton(group=fixedrb, >- label=_("Fill all space _up " >- "to (MB):")) >- maxsizeAdj = gtk.Adjustment(value = 1, lower = 1, >- upper = MAX_PART_SIZE, step_incr = 1) >- fillmaxszsb = gtk.SpinButton(maxsizeAdj, digits = 0) >- fillmaxszsb.set_property('numeric', True) >- fillmaxszhbox = gtk.HBox() >- fillmaxszhbox.pack_start(fillmaxszrb) >- fillmaxszhbox.pack_start(fillmaxszsb) >- fillunlimrb = gtk.RadioButton(group=fixedrb, >- label=_("Fill to maximum _allowable " >- "size")) >- >- fillmaxszrb.connect("toggled", fillmaxszCB, fillmaxszsb) >- >- # default to fixed, turn off max size spinbutton >- fillmaxszsb.set_sensitive(0) >- if request.grow: >- if request.maxSizeMB != None: >- fillmaxszrb.set_active(1) >- fillmaxszsb.set_sensitive(1) >- fillmaxszsb.set_value(request.maxSizeMB) >- else: >- fillunlimrb.set_active(1) >- else: >- fixedrb.set_active(1) >- >- sizeoptiontable.attach(fixedrb, 0, 1, 0, 1) >- sizeoptiontable.attach(fillmaxszhbox, 0, 1, 1, 2) >- sizeoptiontable.attach(fillunlimrb, 0, 1, 2, 3) >- >- frame.add(sizeoptiontable) >- >- return (frame, fixedrb, fillmaxszrb, fillmaxszsb) >+ frame = gtk.Frame(_("Additional Size Options")) >+ sizeoptiontable = gtk.Table() >+ sizeoptiontable.set_row_spacings(5) >+ sizeoptiontable.set_border_width(4) >+ >+ fixedrb = gtk.RadioButton(label=_("_Fixed size")) >+ fillmaxszrb = gtk.RadioButton(group=fixedrb, >+ label=_("Fill all space _up " >+ "to (MB):")) >+ maxsizeAdj = gtk.Adjustment(value = 1, lower = 1, >+ upper = MAX_PART_SIZE, step_incr = 1) >+ fillmaxszsb = gtk.SpinButton(maxsizeAdj, digits = 0) >+ fillmaxszsb.set_property('numeric', True) >+ fillmaxszhbox = gtk.HBox() >+ fillmaxszhbox.pack_start(fillmaxszrb) >+ fillmaxszhbox.pack_start(fillmaxszsb) >+ fillunlimrb = gtk.RadioButton(group=fixedrb, >+ label=_("Fill to maximum _allowable " >+ "size")) >+ >+ fillmaxszrb.connect("toggled", fillmaxszCB, fillmaxszsb) >+ >+ # default to fixed, turn off max size spinbutton >+ fillmaxszsb.set_sensitive(0) >+ if request.grow: >+ if request.maxSizeMB != None: >+ fillmaxszrb.set_active(1) >+ fillmaxszsb.set_sensitive(1) >+ fillmaxszsb.set_value(request.maxSizeMB) >+ else: >+ fillunlimrb.set_active(1) >+ else: >+ fixedrb.set_active(1) >+ >+ sizeoptiontable.attach(fixedrb, 0, 1, 0, 1) >+ sizeoptiontable.attach(fillmaxszhbox, 0, 1, 1, 2) >+ sizeoptiontable.attach(fillunlimrb, 0, 1, 2, 3) >+ >+ frame.add(sizeoptiontable) >+ >+ return (frame, fixedrb, fillmaxszrb, fillmaxszsb) > > > def run(self): >- if self.dialog is None: >- return None >+ if self.dialog is None: >+ return None > > while 1: > rc = self.dialog.run() >- >+ > # user hit cancel, do nothing > if rc == 2: > self.destroy() >@@ -179,21 +179,21 @@ class PartitionEditor: > else: > maxsize = None > >- allowdrives = [] >- model = self.driveview.get_model() >- iter = model.get_iter_first() >- while iter: >- val = model.get_value(iter, 0) >- drive = model.get_value(iter, 1) >+ allowdrives = [] >+ model = self.driveview.get_model() >+ iter = model.get_iter_first() >+ while iter: >+ val = model.get_value(iter, 0) >+ drive = model.get_value(iter, 1) > >- if val: >- allowdrives.append(drive) >+ if val: >+ allowdrives.append(drive) > > iter = model.iter_next(iter) > > if len(allowdrives) == len(self.diskset.disks.keys()): > allowdrives = None >- >+ > request.size = self.sizespin.get_value_as_int() > request.drive = allowdrives > request.grow = grow >@@ -215,10 +215,10 @@ class PartitionEditor: > > continue > >- err = request.sanityCheckRequest(self.partitions) >- if not err: >- err = doUIRAIDLVMChecks(request, self.diskset) >- >+ err = request.sanityCheckRequest(self.partitions) >+ if not err: >+ err = doUIRAIDLVMChecks(request, self.diskset) >+ > if err: > self.intf.messageWindow(_("Error With Request"), > "%s" % (err), custom_icon="error") >@@ -227,15 +227,15 @@ class PartitionEditor: > # preexisting partition, just set mount point and format flag > request = copy.copy(self.origrequest) > request.encryption = copy.deepcopy(self.origrequest.encryption) >- >- if self.fsoptionsDict.has_key("formatcb"): >+ >+ if self.fsoptionsDict.has_key("formatcb"): > request.format = self.fsoptionsDict["formatcb"].get_active() > if request.format: > request.fstype = self.fsoptionsDict["fstypeCombo"].get_active_value() > else: > request.format = 0 > >- if self.fsoptionsDict.has_key("migratecb"): >+ if self.fsoptionsDict.has_key("migratecb"): > request.migrate = self.fsoptionsDict["migratecb"].get_active() > if request.migrate: > request.fstype =self.fsoptionsDict["migfstypeCombo"].get_active_value() >@@ -248,7 +248,7 @@ class PartitionEditor: > request.targetSize = None > > # set back if we are not formatting or migrating >- origfstype = self.origrequest.origfstype >+ origfstype = self.origrequest.origfstype > if not request.format and not request.migrate: > request.fstype = origfstype > >@@ -297,36 +297,36 @@ class PartitionEditor: > request.mountpoint and request.formatByDefault()): > if not queryNoFormatPreExisting(self.intf): > continue >- >- # everything ok, fall out of loop >- break >+ >+ # everything ok, fall out of loop >+ break > >- return request >+ return request > > def destroy(self): >- if self.dialog: >- self.dialog.destroy() >- self.dialog = None >+ if self.dialog: >+ self.dialog.destroy() >+ self.dialog = None > > > def __init__(self, anaconda, parent, origrequest, isNew = 0, > restrictfs = None): > self.anaconda = anaconda >- self.partitions = self.anaconda.id.partitions >- self.diskset = self.anaconda.id.diskset >- self.intf = self.anaconda.intf >- self.origrequest = origrequest >- self.isNew = isNew >- self.parent = parent >- >- if isNew: >- tstr = _("Add Partition") >- else: >- try: >- tstr = _("Edit Partition: /dev/%s") % (origrequest.device,) >- except: >- tstr = _("Edit Partition") >- >+ self.partitions = self.anaconda.id.partitions >+ self.diskset = self.anaconda.id.diskset >+ self.intf = self.anaconda.intf >+ self.origrequest = origrequest >+ self.isNew = isNew >+ self.parent = parent >+ >+ if isNew: >+ tstr = _("Add Partition") >+ else: >+ try: >+ tstr = _("Edit Partition: /dev/%s") % (origrequest.device,) >+ except: >+ tstr = _("Edit Partition") >+ > self.dialog = gtk.Dialog(tstr, self.parent) > gui.addFrame(self.dialog) > self.dialog.add_button('gtk-cancel', 2) >@@ -343,23 +343,23 @@ class PartitionEditor: > self.newbycyl = self.origrequest.start != None > > # Mount Point entry >- lbl = createAlignedLabel(_("_Mount Point:")) >+ lbl = createAlignedLabel(_("_Mount Point:")) > maintable.attach(lbl, 0, 1, row, row + 1) > self.mountCombo = createMountPointCombo(origrequest) >- lbl.set_mnemonic_widget(self.mountCombo) >+ lbl.set_mnemonic_widget(self.mountCombo) > maintable.attach(self.mountCombo, 1, 2, row, row + 1) > row = row + 1 > > # Partition Type > if self.origrequest.type == REQUEST_NEW: >- lbl = createAlignedLabel(_("File System _Type:")) >+ lbl = createAlignedLabel(_("File System _Type:")) > maintable.attach(lbl, 0, 1, row, row + 1) > > self.newfstypeCombo = createFSTypeMenu(self.origrequest.fstype, > fstypechangeCB, > self.mountCombo, > availablefstypes = restrictfs) >- lbl.set_mnemonic_widget(self.newfstypeCombo) >+ lbl.set_mnemonic_widget(self.newfstypeCombo) > maintable.attach(self.newfstypeCombo, 1, 2, row, row + 1) > else: > self.newfstypeCombo = None >@@ -369,20 +369,20 @@ class PartitionEditor: > # allowable drives > if self.origrequest.type == REQUEST_NEW: > if not self.newbycyl: >- lbl = createAlignedLabel(_("Allowable _Drives:")) >+ lbl = createAlignedLabel(_("Allowable _Drives:")) > maintable.attach(lbl, 0, 1, row, row + 1) > > self.driveview = createAllowedDrivesList(self.diskset.disks, > self.origrequest.drive, > selectDrives=False, > disallowDrives=[self.anaconda.updateSrc]) >- lbl.set_mnemonic_widget(self.driveview) >+ lbl.set_mnemonic_widget(self.driveview) > sw = gtk.ScrolledWindow() > sw.add(self.driveview) > sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) >- sw.set_shadow_type(gtk.SHADOW_IN) >+ sw.set_shadow_type(gtk.SHADOW_IN) > maintable.attach(sw, 1, 2, row, row + 1) >- self.driveview.set_size_request(375, 80) >+ self.driveview.set_size_request(375, 80) > else: > maintable.attach(createAlignedLabel(_("Drive:")), > 0, 1, row, row + 1) >@@ -405,7 +405,7 @@ class PartitionEditor: > if self.origrequest.type == REQUEST_NEW: > if not self.newbycyl: > # Size specification >- lbl = createAlignedLabel(_("_Size (MB):")) >+ lbl = createAlignedLabel(_("_Size (MB):")) > maintable.attach(lbl, 0, 1, row, row + 1) > sizeAdj = gtk.Adjustment(value = 1, lower = 1, > upper = MAX_PART_SIZE, step_incr = 1) >@@ -415,7 +415,7 @@ class PartitionEditor: > if self.origrequest.size: > self.sizespin.set_value(self.origrequest.size) > >- lbl.set_mnemonic_widget(self.sizespin) >+ lbl.set_mnemonic_widget(self.sizespin) > maintable.attach(self.sizespin, 1, 2, row, row + 1) > bycyl_sizelabel = None > else: >@@ -428,7 +428,7 @@ class PartitionEditor: > maintable.attach(bycyl_sizelabel, 1, 2, row, row + 1) > row = row + 1 > >- lbl = createAlignedLabel(_("_Start Cylinder:")) >+ lbl = createAlignedLabel(_("_Start Cylinder:")) > maintable.attach(lbl, 0, 1, row, row + 1) > > maxcyl = self.diskset.disks[origrequest.drive[0]].dev.cylinders >@@ -438,7 +438,7 @@ class PartitionEditor: > step_incr=1) > self.startcylspin = gtk.SpinButton(cylAdj, digits=0) > self.startcylspin.set_property('numeric', True) >- lbl.set_mnemonic_widget(self.startcylspin) >+ lbl.set_mnemonic_widget(self.startcylspin) > maintable.attach(self.startcylspin, 1, 2, row, row + 1) > row = row + 1 > >@@ -446,19 +446,19 @@ class PartitionEditor: > lower=origrequest.start, > upper=maxcyl, > step_incr=1) >- lbl = createAlignedLabel(_("_End Cylinder:")) >+ lbl = createAlignedLabel(_("_End Cylinder:")) > maintable.attach(lbl, 0, 1, row, row + 1) > self.endcylspin = gtk.SpinButton(endcylAdj, digits = 0) > self.endcylspin.set_property('numeric', True) >- lbl.set_mnemonic_widget(self.endcylspin) >+ lbl.set_mnemonic_widget(self.endcylspin) > maintable.attach(self.endcylspin, 1, 2, row, row + 1) > > self.startcylspin.connect("value-changed", self.cylspinchangedCB, >- (dev, self.startcylspin, >- self.endcylspin, bycyl_sizelabel)) >+ (dev, self.startcylspin, >+ self.endcylspin, bycyl_sizelabel)) > self.endcylspin.connect("value-changed", self.cylspinchangedCB, >- (dev, self.startcylspin, >- self.endcylspin, bycyl_sizelabel)) >+ (dev, self.startcylspin, >+ self.endcylspin, bycyl_sizelabel)) > > startsec = start_cyl_to_sector(dev, origrequest.start) > endsec = end_cyl_to_sector(dev, origrequest.end) >@@ -471,18 +471,18 @@ class PartitionEditor: > > # format/migrate options for pre-existing partitions, as long as they > # aren't protected (we'd still like to be able to mount them, though) >- self.fsoptionsDict = {} >+ self.fsoptionsDict = {} > if self.origrequest.type == REQUEST_PREEXIST and self.origrequest.fstype and not self.origrequest.getProtected(): >- (row, self.fsoptionsDict) = createPreExistFSOptionSection(self.origrequest, maintable, row, self.mountCombo, self.partitions) >+ (row, self.fsoptionsDict) = createPreExistFSOptionSection(self.origrequest, maintable, row, self.mountCombo, self.partitions) > > # size options > if self.origrequest.type == REQUEST_NEW: > if not self.newbycyl: > (sizeframe, self.fixedrb, self.fillmaxszrb, > self.fillmaxszsb) = self.createSizeOptionsFrame(self.origrequest, >- self.fillmaxszCB) >+ self.fillmaxszCB) > self.sizespin.connect("value-changed", self.sizespinchangedCB, >- self.fillmaxszsb) >+ self.fillmaxszsb) > > maintable.attach(sizeframe, 0, 2, row, row + 1) > else: >diff --git a/iw/partition_gui.py b/iw/partition_gui.py >index 7520651..e209e43 100644 >--- a/iw/partition_gui.py >+++ b/iw/partition_gui.py >@@ -315,19 +315,19 @@ class DiskStripeGraph: > x=0.0, y=yoff, > font="sans", > size_points=9) >- show_geometry = 0 >- if show_geometry: >- drivetext = _("Drive %s (Geom: %s/%s/%s) " >- "(Model: %s)") % ('/dev/' + drive, >- disk.dev.cylinders, >- disk.dev.heads, >- disk.dev.sectors, >- disk.dev.model) >- else: >- drivetext = _("Drive %s (%-0.f MB) " >- "(Model: %s)") % ('/dev/' + drive, >- partedUtils.getDeviceSizeMB(disk.dev), >- disk.dev.model) >+ show_geometry = 0 >+ if show_geometry: >+ drivetext = _("Drive %s (Geom: %s/%s/%s) " >+ "(Model: %s)") % ('/dev/' + drive, >+ disk.dev.cylinders, >+ disk.dev.heads, >+ disk.dev.sectors, >+ disk.dev.model) >+ else: >+ drivetext = _("Drive %s (%-0.f MB) " >+ "(Model: %s)") % ('/dev/' + drive, >+ partedUtils.getDeviceSizeMB(disk.dev), >+ disk.dev.model) > > > text.set(text=drivetext, fill_color='black', anchor=gtk.ANCHOR_NW, >@@ -376,14 +376,14 @@ class DiskTreeModel(gtk.TreeStore): > (N_("Size (MB)"), gobject.TYPE_STRING, 1.0, 0, 0), > (N_("Start"), gobject.TYPE_STRING, 1.0, 0, 1), > (N_("End"), gobject.TYPE_STRING, 1.0, 0, 1), >- ("", gobject.TYPE_STRING, 0.0, 0, 0), >+ ("", gobject.TYPE_STRING, 0.0, 0, 0), > # the following must be the last two > ("IsLeaf", gobject.TYPE_BOOLEAN, 0.0, 1, 0), > ("IsFormattable", gobject.TYPE_BOOLEAN, 0.0, 1, 0), > ("PyObject", gobject.TYPE_PYOBJECT, 0.0, 1, 0)) > > def __init__(self): >- self.hiddenPartitions = [] >+ self.hiddenPartitions = [] > self.titleSlot = {} > i = 0 > types = [self] >@@ -403,7 +403,7 @@ class DiskTreeModel(gtk.TreeStore): > elif (kind == gobject.TYPE_STRING or > kind == gobject.TYPE_INT): > renderer = gtk.CellRendererText() >- propertyMapping = {'text': i} >+ propertyMapping = {'text': i} > > # wire in the cells that we want only visible on leaf nodes to > # the special leaf node column. >@@ -411,17 +411,17 @@ class DiskTreeModel(gtk.TreeStore): > propertyMapping['visible'] = len(self.titles) + key > > renderer.set_property('xalign', alignment) >- if title == "Mount Point": >- title = _("Mount Point/\nRAID/Volume") >- elif title == "Size (MB)": >- title = _("Size\n(MB)") >+ if title == "Mount Point": >+ title = _("Mount Point/\nRAID/Volume") >+ elif title == "Size (MB)": >+ title = _("Size\n(MB)") > elif title != "": > title = _(title) > col = apply(gtk.TreeViewColumn, (title, renderer), > propertyMapping) >- col.set_alignment(0.5) >- if kind == gobject.TYPE_STRING or kind == gobject.TYPE_INT: >- col.set_property('sizing', gtk.TREE_VIEW_COLUMN_AUTOSIZE) >+ col.set_alignment(0.5) >+ if kind == gobject.TYPE_STRING or kind == gobject.TYPE_INT: >+ col.set_property('sizing', gtk.TREE_VIEW_COLUMN_AUTOSIZE) > self.columns.append(col) > i += 1 > >@@ -435,20 +435,20 @@ class DiskTreeModel(gtk.TreeStore): > return self.view > > def clearHiddenPartitionsList(self): >- self.hiddenPartitions = [] >+ self.hiddenPartitions = [] > > def appendToHiddenPartitionsList(self, member): >- self.hiddenPartitions.append(member) >+ self.hiddenPartitions.append(member) > > def selectPartition(self, partition): >- # if we've hidden this partition in the tree view just return >- if partition in self.hiddenPartitions: >- return >- >+ # if we've hidden this partition in the tree view just return >+ if partition in self.hiddenPartitions: >+ return >+ > pyobject = self.titleSlot['PyObject'] > iter = self.get_iter_first() >- parentstack = [None,] >- parent = None >+ parentstack = [None,] >+ parent = None > # iterate over the list, looking for the current mouse selection > while iter: > try: >@@ -498,7 +498,7 @@ class DiskTreeModel(gtk.TreeStore): > return None > > pyobject = self.titleSlot['PyObject'] >- try: >+ try: > val = self.get_value(iter, pyobject) > if type(val) == type("/dev/"): > if val[:5] == '/dev/': >@@ -516,7 +516,7 @@ class DiskTreeModel(gtk.TreeStore): > return None > > pyobject = self.titleSlot['PyObject'] >- try: >+ try: > val = self.get_value(iter, pyobject) > if type(val) == type("/dev/"): > if val[:5] == '/dev/': >@@ -545,7 +545,7 @@ class DiskTreeModel(gtk.TreeStore): > > class PartitionWindow(InstallWindow): > def __init__(self, ics): >- InstallWindow.__init__(self, ics) >+ InstallWindow.__init__(self, ics) > ics.setTitle(_("Partitioning")) > ics.setNextEnabled(True) > self.parent = ics.getICW().window >@@ -554,7 +554,7 @@ class PartitionWindow(InstallWindow): > pass > > def presentPartitioningComments(self,title, labelstr1, labelstr2, comments, >- type="ok", custom_buttons=None): >+ type="ok", custom_buttons=None): > > if flags.autostep: > return 1 >@@ -564,29 +564,29 @@ class PartitionWindow(InstallWindow): > > if type == "ok": > win.add_button('gtk-ok', 1) >- defaultchoice = 0 >+ defaultchoice = 0 > elif type == "yesno": > win.add_button('gtk-no', 2) > win.add_button('gtk-yes', 1) >- defaultchoice = 1 >- elif type == "continue": >+ defaultchoice = 1 >+ elif type == "continue": > win.add_button('gtk-cancel', 0) > win.add_button(_("Continue"), 1) >- defaultchoice = 1 >- elif type == "custom": >- rid=0 >+ defaultchoice = 1 >+ elif type == "custom": >+ rid=0 > >- for button in custom_buttons: >- widget = win.add_button(button, rid) >- rid = rid + 1 >+ for button in custom_buttons: >+ widget = win.add_button(button, rid) >+ rid = rid + 1 > > defaultchoice = rid - 1 >- >+ > image = gtk.Image() > image.set_from_stock('gtk-dialog-warning', gtk.ICON_SIZE_DIALOG) > hbox = gtk.HBox(False, 9) >- al=gtk.Alignment(0.0, 0.0) >- al.add(image) >+ al=gtk.Alignment(0.0, 0.0) >+ al.add(image) > hbox.pack_start(al, False) > > buffer = gtk.TextBuffer(None) >@@ -599,7 +599,7 @@ class PartitionWindow(InstallWindow): > > sw = gtk.ScrolledWindow() > sw.add(text) >- sw.set_size_request(400, 200) >+ sw.set_size_request(400, 200) > sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) > sw.set_shadow_type(gtk.SHADOW_IN) > >@@ -613,16 +613,16 @@ class PartitionWindow(InstallWindow): > > vbox = gtk.VBox(False, 9) > >- al=gtk.Alignment(0.0, 0.0) >- al.add(info1) >+ al=gtk.Alignment(0.0, 0.0) >+ al.add(info1) > vbox.pack_start(al, False) >- >+ > vbox.pack_start(sw, True, True) > >- al=gtk.Alignment(0.0, 0.0) >- al.add(info2) >+ al=gtk.Alignment(0.0, 0.0) >+ al.add(info2) > vbox.pack_start(al, True) >- >+ > hbox.pack_start(vbox, True, True) > > win.vbox.pack_start(hbox) >@@ -661,7 +661,7 @@ class PartitionWindow(InstallWindow): > rc = self.presentPartitioningComments(_("Partitioning Warnings"), > labelstr1, labelstr2, > commentstr, >- type="yesno") >+ type="yesno") > if rc != 1: > raise gui.StayOnScreen > >@@ -683,9 +683,9 @@ class PartitionWindow(InstallWindow): > rc = self.presentPartitioningComments(_("Format Warnings"), > labelstr1, labelstr2, > commentstr, >- type="custom", >- custom_buttons=["gtk-cancel", >- _("_Format")]) >+ type="custom", >+ custom_buttons=["gtk-cancel", >+ _("_Format")]) > if rc != 1: > raise gui.StayOnScreen > >@@ -704,10 +704,10 @@ class PartitionWindow(InstallWindow): > return None > > def getShortFSTypeName(self, name): >- if name == "physical volume (LVM)": >- return "LVM PV" >+ if name == "physical volume (LVM)": >+ return "LVM PV" > >- return name >+ return name > > def populate(self, initial = 0): > >@@ -716,79 +716,79 @@ class PartitionWindow(InstallWindow): > > self.tree.resetSelection() > >- self.tree.clearHiddenPartitionsList() >+ self.tree.clearHiddenPartitionsList() > >- # first do LVM >+ # first do LVM > lvmrequests = self.partitions.getLVMRequests() > if lvmrequests: >- lvmparent = self.tree.append(None) >- self.tree[lvmparent]['Device'] = _("LVM Volume Groups") >+ lvmparent = self.tree.append(None) >+ self.tree[lvmparent]['Device'] = _("LVM Volume Groups") > for vgname in lvmrequests.keys(): >- vgrequest = self.partitions.getRequestByVolumeGroupName(vgname) >- rsize = vgrequest.getActualSize(self.partitions, self.diskset) >+ vgrequest = self.partitions.getRequestByVolumeGroupName(vgname) >+ rsize = vgrequest.getActualSize(self.partitions, self.diskset) > > vgparent = self.tree.append(lvmparent) >- self.tree[vgparent]['Device'] = "%s" % (vgname,) >+ self.tree[vgparent]['Device'] = "%s" % (vgname,) > if vgrequest and vgrequest.type != REQUEST_NEW and vgrequest.fslabel: > self.tree[vgparent]['Label'] = "%s" % (vgrequest.fslabel,) > else: > self.tree[vgparent]['Label'] = "" >- self.tree[vgparent]['Mount Point'] = "" >- self.tree[vgparent]['Start'] = "" >- self.tree[vgparent]['End'] = "" >- self.tree[vgparent]['Size (MB)'] = "%Ld" % (rsize,) >+ self.tree[vgparent]['Mount Point'] = "" >+ self.tree[vgparent]['Start'] = "" >+ self.tree[vgparent]['End'] = "" >+ self.tree[vgparent]['Size (MB)'] = "%Ld" % (rsize,) > self.tree[vgparent]['PyObject'] = str(vgrequest.uniqueID) >- for lvrequest in lvmrequests[vgname]: >- iter = self.tree.append(vgparent) >- self.tree[iter]['Device'] = lvrequest.logicalVolumeName >- if lvrequest.fstype and lvrequest.mountpoint: >- self.tree[iter]['Mount Point'] = lvrequest.mountpoint >- else: >- self.tree[iter]['Mount Point'] = "" >- self.tree[iter]['Size (MB)'] = "%Ld" % (lvrequest.getActualSize(self.partitions, self.diskset, True),) >- self.tree[iter]['PyObject'] = str(lvrequest.uniqueID) >- >+ for lvrequest in lvmrequests[vgname]: >+ iter = self.tree.append(vgparent) >+ self.tree[iter]['Device'] = lvrequest.logicalVolumeName >+ if lvrequest.fstype and lvrequest.mountpoint: >+ self.tree[iter]['Mount Point'] = lvrequest.mountpoint >+ else: >+ self.tree[iter]['Mount Point'] = "" >+ self.tree[iter]['Size (MB)'] = "%Ld" % (lvrequest.getActualSize(self.partitions, self.diskset, True),) >+ self.tree[iter]['PyObject'] = str(lvrequest.uniqueID) >+ > ptype = lvrequest.fstype.getName() > if lvrequest.isEncrypted(self.partitions, True) and lvrequest.format: >- self.tree[iter]['Format'] = self.lock_pixbuf >+ self.tree[iter]['Format'] = self.lock_pixbuf > elif lvrequest.format: >- self.tree[iter]['Format'] = self.checkmark_pixbuf >+ self.tree[iter]['Format'] = self.checkmark_pixbuf > self.tree[iter]['IsFormattable'] = lvrequest.fstype.isFormattable() >- self.tree[iter]['IsLeaf'] = True >- self.tree[iter]['Type'] = ptype >- self.tree[iter]['Start'] = "" >- self.tree[iter]['End'] = "" >+ self.tree[iter]['IsLeaf'] = True >+ self.tree[iter]['Type'] = ptype >+ self.tree[iter]['Start'] = "" >+ self.tree[iter]['End'] = "" > > # handle RAID next > raidrequests = self.partitions.getRaidRequests() > if raidrequests: >- raidparent = self.tree.append(None) >- self.tree[raidparent]['Device'] = _("RAID Devices") >+ raidparent = self.tree.append(None) >+ self.tree[raidparent]['Device'] = _("RAID Devices") > for request in raidrequests: >- mntpt = None >- if request and request.fstype and request.fstype.getName() == "physical volume (LVM)": >- vgreq = self.partitions.getLVMVolumeGroupMemberParent(request) >- if vgreq and vgreq.volumeGroupName: >- if self.show_uneditable: >- mntpt = vgreq.volumeGroupName >- else: >- self.tree.appendToHiddenPartitionsList(str(request.uniqueID)) >- continue >- else: >- mntpt = "" >+ mntpt = None >+ if request and request.fstype and request.fstype.getName() == "physical volume (LVM)": >+ vgreq = self.partitions.getLVMVolumeGroupMemberParent(request) >+ if vgreq and vgreq.volumeGroupName: >+ if self.show_uneditable: >+ mntpt = vgreq.volumeGroupName >+ else: >+ self.tree.appendToHiddenPartitionsList(str(request.uniqueID)) >+ continue >+ else: >+ mntpt = "" > > iter = self.tree.append(raidparent) >- if mntpt: >+ if mntpt: > self.tree[iter]["Mount Point"] = mntpt >- >+ > if request and request.mountpoint: > self.tree[iter]["Mount Point"] = request.mountpoint >- >+ > if request.fstype: > ptype = self.getShortFSTypeName(request.fstype.getName()) > > if request.isEncrypted(self.partitions, True) and request.format: >- self.tree[iter]['Format'] = self.lock_pixbuf >+ self.tree[iter]['Format'] = self.lock_pixbuf > elif request.format: > self.tree[iter]['Format'] = self.checkmark_pixbuf > self.tree[iter]['IsFormattable'] = request.fstype.isFormattable() >@@ -796,11 +796,11 @@ class PartitionWindow(InstallWindow): > ptype = _("None") > self.tree[iter]['IsFormattable'] = False > >- try: >- device = "/dev/md%d" % (request.raidminor,) >- except: >- device = "Auto" >- >+ try: >+ device = "/dev/md%d" % (request.raidminor,) >+ except: >+ device = "Auto" >+ > self.tree[iter]['IsLeaf'] = True > self.tree[iter]['Device'] = device > if request and request.type != REQUEST_NEW and request.fslabel: >@@ -813,9 +813,9 @@ class PartitionWindow(InstallWindow): > self.tree[iter]['Size (MB)'] = "%Ld" % (request.getActualSize(self.partitions, self.diskset),) > self.tree[iter]['PyObject'] = str(request.uniqueID) > >- # now normal partitions >- drvparent = self.tree.append(None) >- self.tree[drvparent]['Device'] = _("Hard Drives") >+ # now normal partitions >+ drvparent = self.tree.append(None) >+ self.tree[drvparent]['Device'] = _("Hard Drives") > for drive in drives: > disk = self.diskset.disks[drive] > >@@ -865,25 +865,25 @@ class PartitionWindow(InstallWindow): > else: > self.tree[iter]['Mount Point'] = "" > >- if request and request.fstype and request.fstype.getName() == "physical volume (LVM)": >- vgreq = self.partitions.getLVMVolumeGroupMemberParent(request) >- if vgreq and vgreq.volumeGroupName: >- if self.show_uneditable: >- self.tree[iter]['Mount Point'] = vgreq.volumeGroupName >- else: >- self.tree.appendToHiddenPartitionsList(part) >- part = disk.next_partition(part) >- self.tree.remove(iter) >- continue >- else: >- self.tree[iter]['Mount Point'] = "" >+ if request and request.fstype and request.fstype.getName() == "physical volume (LVM)": >+ vgreq = self.partitions.getLVMVolumeGroupMemberParent(request) >+ if vgreq and vgreq.volumeGroupName: >+ if self.show_uneditable: >+ self.tree[iter]['Mount Point'] = vgreq.volumeGroupName >+ else: >+ self.tree.appendToHiddenPartitionsList(part) >+ part = disk.next_partition(part) >+ self.tree.remove(iter) >+ continue >+ else: >+ self.tree[iter]['Mount Point'] = "" > > if request.isEncrypted(self.partitions, True) and request.format: > self.tree[iter]['Format'] = self.lock_pixbuf >- elif request.format: >- self.tree[iter]['Format'] = self.checkmark_pixbuf >+ elif request.format: >+ self.tree[iter]['Format'] = self.checkmark_pixbuf > >- >+ > if request and request.fstype: > self.tree[iter]['IsFormattable'] = request.fstype.isFormattable() > >@@ -893,24 +893,24 @@ class PartitionWindow(InstallWindow): > ptype = _("Extended") > elif part.get_flag(parted.PARTITION_RAID) == 1: > ptype = _("software RAID") >- parreq = self.partitions.getRaidMemberParent(request) >- if parreq: >- if self.show_uneditable: >- try: >- mddevice = "/dev/md%d" % (parreq.raidminor,) >- except: >- mddevice = "Auto" >- self.tree[iter]['Mount Point'] = mddevice >- else: >- self.tree.appendToHiddenPartitionsList(part) >- part = disk.next_partition(part) >- self.tree.remove(iter) >- continue >- else: >- self.tree[iter]['Mount Point'] = "" >+ parreq = self.partitions.getRaidMemberParent(request) >+ if parreq: >+ if self.show_uneditable: >+ try: >+ mddevice = "/dev/md%d" % (parreq.raidminor,) >+ except: >+ mddevice = "Auto" >+ self.tree[iter]['Mount Point'] = mddevice >+ else: >+ self.tree.appendToHiddenPartitionsList(part) >+ part = disk.next_partition(part) >+ self.tree.remove(iter) >+ continue >+ else: >+ self.tree[iter]['Mount Point'] = "" > > if request.isEncrypted(self.partitions, True) and request.format: >- self.tree[iter]['Format'] = self.lock_pixbuf >+ self.tree[iter]['Format'] = self.lock_pixbuf > elif part.fs_type: > if request and request.fstype != None: > ptype = self.getShortFSTypeName(request.fstype.getName()) >@@ -920,9 +920,9 @@ class PartitionWindow(InstallWindow): > ptype = part.fs_type.name > > if request.isEncrypted(self.partitions, True) and request.format: >- self.tree[iter]['Format'] = self.lock_pixbuf >+ self.tree[iter]['Format'] = self.lock_pixbuf > elif request.format: >- self.tree[iter]['Format'] = self.checkmark_pixbuf >+ self.tree[iter]['Format'] = self.checkmark_pixbuf > else: > if request and request.fstype != None: > ptype = self.getShortFSTypeName(request.fstype.getName()) >@@ -1005,28 +1005,28 @@ class PartitionWindow(InstallWindow): > self.diskStripeGraph.shutDown() > self.tree.clear() > >- # XXXX - Backup some info which doPartitioning munges if it fails >- origInfoDict = {} >- for request in self.partitions.requests: >- try: >- origInfoDict[request.uniqueID] = (request.requestSize, request.currentDrive) >- except: >- pass >+ # XXXX - Backup some info which doPartitioning munges if it fails >+ origInfoDict = {} >+ for request in self.partitions.requests: >+ try: >+ origInfoDict[request.uniqueID] = (request.requestSize, request.currentDrive) >+ except: >+ pass > > try: > autopart.doPartitioning(self.diskset, self.partitions) > rc = 0 > except PartitioningError, msg: >- try: >- for request in self.partitions.requests: >- if request.uniqueID in origInfoDict.keys(): >- (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID] >- except: >- log.error("Failed to restore original info") >+ try: >+ for request in self.partitions.requests: >+ if request.uniqueID in origInfoDict.keys(): >+ (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID] >+ except: >+ log.error("Failed to restore original info") > > self.intf.messageWindow(_("Error Partitioning"), > _("Could not allocate requested partitions: %s.") % (msg), >- custom_icon="error") >+ custom_icon="error") > rc = -1 > except PartitioningWarning, msg: > # XXX somebody other than me should make this look better >@@ -1055,8 +1055,8 @@ class PartitionWindow(InstallWindow): > for req in reqs: > req.ignoreBootConstraints = 1 > >- if not rc == -1: >- self.populate() >+ if not rc == -1: >+ self.populate() > > return rc > >@@ -1068,63 +1068,63 @@ class PartitionWindow(InstallWindow): > if request: > if type == "RAID": > self.editRaidRequest(request) >- elif type == "LVMVG": >- self.editLVMVolumeGroup(request) >- elif type == "LVMLV": >- vgrequest = self.partitions.getRequestByID(request.volumeGroup) >- self.editLVMVolumeGroup(vgrequest) >+ elif type == "LVMVG": >+ self.editLVMVolumeGroup(request) >+ elif type == "LVMLV": >+ vgrequest = self.partitions.getRequestByID(request.volumeGroup) >+ self.editLVMVolumeGroup(vgrequest) > elif type == "NEW": >- self.editPartitionRequest(request, isNew = 1) >+ self.editPartitionRequest(request, isNew = 1) > else: > self.editPartitionRequest(request) > > # isNew implies that this request has never been successfully used before > def editRaidRequest(self, raidrequest, isNew = 0): >- raideditor = raid_dialog_gui.RaidEditor(self.partitions, >- self.diskset, self.intf, >- self.parent, raidrequest, >- isNew) >- origpartitions = self.partitions.copy() >- >- while 1: >- request = raideditor.run() >- >- if request is None: >- return >- >- if not isNew: >- self.partitions.removeRequest(raidrequest) >+ raideditor = raid_dialog_gui.RaidEditor(self.partitions, >+ self.diskset, self.intf, >+ self.parent, raidrequest, >+ isNew) >+ origpartitions = self.partitions.copy() >+ >+ while 1: >+ request = raideditor.run() >+ >+ if request is None: >+ return >+ >+ if not isNew: >+ self.partitions.removeRequest(raidrequest) > if raidrequest.getPreExisting(): > delete = partRequests.DeleteRAIDSpec(raidrequest.raidminor) > self.partitions.addDelete(delete) > >- self.partitions.addRequest(request) >+ self.partitions.addRequest(request) > >- if self.refresh(): >- if not isNew: >- self.partitions = origpartitions.copy() >+ if self.refresh(): >+ if not isNew: >+ self.partitions = origpartitions.copy() > if self.refresh(): > raise RuntimeError, ("Returning partitions to state " > "prior to RAID edit failed") > continue >- else: >- break >+ else: >+ break > >- raideditor.destroy() >+ raideditor.destroy() > > > def editPartitionRequest(self, origrequest, isNew = 0, restrictfs = None): >- parteditor = partition_dialog_gui.PartitionEditor(self.anaconda, >- self.parent, >- origrequest, >- isNew = isNew, >+ parteditor = partition_dialog_gui.PartitionEditor(self.anaconda, >+ self.parent, >+ origrequest, >+ isNew = isNew, > restrictfs = restrictfs) > >- while 1: >- request = parteditor.run() >+ while 1: >+ request = parteditor.run() > >- if request is None: >- return 0 >+ if request is None: >+ return 0 > > if not isNew: > self.partitions.removeRequest(origrequest) >@@ -1141,34 +1141,34 @@ class PartitionWindow(InstallWindow): > raise RuntimeError, ("Returning partitions to state " > "prior to edit failed") > else: >- break >+ break > >- parteditor.destroy() >- return 1 >+ parteditor.destroy() >+ return 1 > > def editLVMVolumeGroup(self, origvgrequest, isNew = 0): >- vgeditor = lvm_dialog_gui.VolumeGroupEditor(self.partitions, >- self.diskset, >- self.intf, self.parent, >- origvgrequest, isNew) >- >- origpartitions = self.partitions.copy() >- origvolreqs = origpartitions.getLVMLVForVG(origvgrequest) >- >- while (1): >- rc = vgeditor.run() >- >- # >- # return code is either None or a tuple containing >- # volume group request and logical volume requests >- # >- if rc is None: >- return >- >- (vgrequest, logvolreqs) = rc >- >- # first add the volume group >- if not isNew: >+ vgeditor = lvm_dialog_gui.VolumeGroupEditor(self.partitions, >+ self.diskset, >+ self.intf, self.parent, >+ origvgrequest, isNew) >+ >+ origpartitions = self.partitions.copy() >+ origvolreqs = origpartitions.getLVMLVForVG(origvgrequest) >+ >+ while (1): >+ rc = vgeditor.run() >+ >+ # >+ # return code is either None or a tuple containing >+ # volume group request and logical volume requests >+ # >+ if rc is None: >+ return >+ >+ (vgrequest, logvolreqs) = rc >+ >+ # first add the volume group >+ if not isNew: > # if an lv was preexisting and isn't in the new lv requests, > # we need to add a delete for it. > for lv in origvolreqs: >@@ -1185,121 +1185,121 @@ class PartitionWindow(InstallWindow): > origvgrequest.volumeGroupName) > self.partitions.addDelete(delete) > >- for lv in origvolreqs: >- self.partitions.removeRequest(lv) >+ for lv in origvolreqs: >+ self.partitions.removeRequest(lv) > >- self.partitions.removeRequest(origvgrequest) >+ self.partitions.removeRequest(origvgrequest) > >- vgID = self.partitions.addRequest(vgrequest) >+ vgID = self.partitions.addRequest(vgrequest) > >- # now add the logical volumes >- for lv in logvolreqs: >- lv.volumeGroup = vgID >+ # now add the logical volumes >+ for lv in logvolreqs: >+ lv.volumeGroup = vgID > if not lv.getPreExisting(): > lv.format = 1 >- self.partitions.addRequest(lv) >+ self.partitions.addRequest(lv) > >- if self.refresh(): >- if not isNew: >- self.partitions = origpartitions.copy() >- if self.refresh(): >- raise RuntimeError, ("Returning partitions to state " >- "prior to edit failed") >- continue >- else: >- break >+ if self.refresh(): >+ if not isNew: >+ self.partitions = origpartitions.copy() >+ if self.refresh(): >+ raise RuntimeError, ("Returning partitions to state " >+ "prior to edit failed") >+ continue >+ else: >+ break > >- vgeditor.destroy() >+ vgeditor.destroy() > > > > def makeLvmCB(self, widget): >- if (not fileSystemTypeGet('physical volume (LVM)').isSupported() or >+ if (not fileSystemTypeGet('physical volume (LVM)').isSupported() or > not lvm.has_lvm()): >- self.intf.messageWindow(_("Not supported"), >- _("LVM is NOT supported on " >- "this platform."), type="ok", >- custom_icon="error") >- return >+ self.intf.messageWindow(_("Not supported"), >+ _("LVM is NOT supported on " >+ "this platform."), type="ok", >+ custom_icon="error") >+ return > > request = VolumeGroupRequestSpec(format=True) > self.editLVMVolumeGroup(request, isNew = 1) > >- return >+ return > > def makeraidCB(self, widget): > >- if not fileSystemTypeGet('software RAID').isSupported(): >- self.intf.messageWindow(_("Not supported"), >- _("Software RAID is NOT supported on " >- "this platform."), type="ok", >- custom_icon="error") >- return >- >- availminors = self.partitions.getAvailableRaidMinors() >- if len(availminors) < 1: >- self.intf.messageWindow(_("No RAID minor device numbers available"), >- _("A software RAID device cannot " >- "be created because all of the " >- "available RAID minor device numbers " >- "have been used."), >- type="ok", custom_icon="error") >- return >- >- >- # see if we have enough free software RAID partitions first >- # if no raid partitions exist, raise an error message and return >- request = RaidRequestSpec(fileSystemTypeGetDefault()) >- availraidparts = self.partitions.getAvailRaidPartitions(request, >- self.diskset) >- >- dialog = gtk.Dialog(_("RAID Options"), self.parent) >- gui.addFrame(dialog) >- dialog.add_button('gtk-cancel', 2) >- dialog.add_button('gtk-ok', 1) >+ if not fileSystemTypeGet('software RAID').isSupported(): >+ self.intf.messageWindow(_("Not supported"), >+ _("Software RAID is NOT supported on " >+ "this platform."), type="ok", >+ custom_icon="error") >+ return >+ >+ availminors = self.partitions.getAvailableRaidMinors() >+ if len(availminors) < 1: >+ self.intf.messageWindow(_("No RAID minor device numbers available"), >+ _("A software RAID device cannot " >+ "be created because all of the " >+ "available RAID minor device numbers " >+ "have been used."), >+ type="ok", custom_icon="error") >+ return >+ >+ >+ # see if we have enough free software RAID partitions first >+ # if no raid partitions exist, raise an error message and return >+ request = RaidRequestSpec(fileSystemTypeGetDefault()) >+ availraidparts = self.partitions.getAvailRaidPartitions(request, >+ self.diskset) >+ >+ dialog = gtk.Dialog(_("RAID Options"), self.parent) >+ gui.addFrame(dialog) >+ dialog.add_button('gtk-cancel', 2) >+ dialog.add_button('gtk-ok', 1) > dialog.set_position(gtk.WIN_POS_CENTER) >- >+ > maintable = gtk.Table() > maintable.set_row_spacings(5) > maintable.set_col_spacings(5) > row = 0 > >- lbltxt = _("Software RAID allows you to combine " >- "several disks into a larger " >- "RAID device. A RAID device can be configured to " >- "provide additional speed and " >- "reliability compared to using an individual drive. " >- "For more information on using RAID devices " >- "please consult the %s documentation.\n\n" >- "You currently have %s software RAID " >- "partition(s) free to use.\n\n") % (productName, len(availraidparts)) >+ lbltxt = _("Software RAID allows you to combine " >+ "several disks into a larger " >+ "RAID device. A RAID device can be configured to " >+ "provide additional speed and " >+ "reliability compared to using an individual drive. " >+ "For more information on using RAID devices " >+ "please consult the %s documentation.\n\n" >+ "You currently have %s software RAID " >+ "partition(s) free to use.\n\n") % (productName, len(availraidparts)) > > if len(availraidparts) < 2: >- lbltxt = lbltxt + _("To use RAID you must first " >- "create at least two partitions of type " >- "'software RAID'. Then you can " >- "create a RAID device that can " >- "be formatted and mounted.\n\n") >- >- lbltxt = lbltxt + _("What do you want to do now?") >- >- lbl = gui.WrappingLabel(lbltxt) >- maintable.attach(lbl, 0, 1, row, row + 1) >- row = row + 1 >- >- newminor = availminors[0] >+ lbltxt = lbltxt + _("To use RAID you must first " >+ "create at least two partitions of type " >+ "'software RAID'. Then you can " >+ "create a RAID device that can " >+ "be formatted and mounted.\n\n") >+ >+ lbltxt = lbltxt + _("What do you want to do now?") >+ >+ lbl = gui.WrappingLabel(lbltxt) >+ maintable.attach(lbl, 0, 1, row, row + 1) >+ row = row + 1 >+ >+ newminor = availminors[0] > radioBox = gtk.VBox (False) > > createRAIDpart = gtk.RadioButton(None, _("Create a software RAID _partition.")) >- radioBox.pack_start(createRAIDpart, False, False, padding=10) >+ radioBox.pack_start(createRAIDpart, False, False, padding=10) > createRAIDdev = gtk.RadioButton(createRAIDpart, >- _("Create a RAID _device [default=/dev/md%s].") % newminor) >- radioBox.pack_start(createRAIDdev, False, False, padding=10) >+ _("Create a RAID _device [default=/dev/md%s].") % newminor) >+ radioBox.pack_start(createRAIDdev, False, False, padding=10) > > doRAIDclone = gtk.RadioButton(createRAIDpart, >- _("Clone a _drive to create a " >- "RAID device [default=/dev/md%s].") % newminor) >- radioBox.pack_start(doRAIDclone, False, False, padding=10) >+ _("Clone a _drive to create a " >+ "RAID device [default=/dev/md%s].") % newminor) >+ radioBox.pack_start(doRAIDclone, False, False, padding=10) > > createRAIDpart.set_active(1) > doRAIDclone.set_sensitive(0) >@@ -1309,28 +1309,28 @@ class PartitionWindow(InstallWindow): > > if len(availraidparts) > 1: > createRAIDdev.set_active(1) >- createRAIDdev.set_sensitive(1) >- >- align = gtk.Alignment(0.5, 0.0) >- align.add(radioBox) >- maintable.attach(align,0,1,row, row+1) >- row = row + 1 >- >- maintable.show_all() >- dialog.vbox.pack_start(maintable) >- dialog.show_all() >- rc = dialog.run() >- dialog.destroy() >- if rc == 2: >- return >- >- # see which option they choose >- if createRAIDpart.get_active(): >- rdrequest = NewPartitionSpec(fileSystemTypeGet("software RAID"), size = 200) >- rc = self.editPartitionRequest(rdrequest, isNew = 1, restrictfs=["software RAID"]) >- elif createRAIDdev.get_active(): >- self.editRaidRequest(request, isNew=1) >- else: >+ createRAIDdev.set_sensitive(1) >+ >+ align = gtk.Alignment(0.5, 0.0) >+ align.add(radioBox) >+ maintable.attach(align,0,1,row, row+1) >+ row = row + 1 >+ >+ maintable.show_all() >+ dialog.vbox.pack_start(maintable) >+ dialog.show_all() >+ rc = dialog.run() >+ dialog.destroy() >+ if rc == 2: >+ return >+ >+ # see which option they choose >+ if createRAIDpart.get_active(): >+ rdrequest = NewPartitionSpec(fileSystemTypeGet("software RAID"), size = 200) >+ rc = self.editPartitionRequest(rdrequest, isNew = 1, restrictfs=["software RAID"]) >+ elif createRAIDdev.get_active(): >+ self.editRaidRequest(request, isNew=1) >+ else: > cloneDialog = raid_dialog_gui.RaidCloneDialog(self.partitions, > self.diskset, > self.intf, >@@ -1339,24 +1339,24 @@ class PartitionWindow(InstallWindow): > self.intf.messageWindow(_("Couldn't Create Drive Clone Editor"), > _("The drive clone editor could not " > "be created for some reason."), >- custom_icon="error") >+ custom_icon="error") > return > > while 1: > rc = cloneDialog.run() > >- if rc: >- self.refresh() >- >+ if rc: >+ self.refresh() >+ > cloneDialog.destroy() >- return >+ return > >- >+ > def viewButtonCB(self, widget): >- self.show_uneditable = not widget.get_active() >+ self.show_uneditable = not widget.get_active() > self.diskStripeGraph.shutDown() >- self.tree.clear() >- self.populate() >+ self.tree.clear() >+ self.populate() > > def getScreen(self, anaconda): > self.anaconda = anaconda >@@ -1367,12 +1367,12 @@ class PartitionWindow(InstallWindow): > self.diskset.openDevices() > self.partitions = anaconda.id.partitions > >- self.show_uneditable = 1 >+ self.show_uneditable = 1 > > checkForSwapNoMatch(anaconda) > >- # load up checkmark >- self.checkmark_pixbuf = gtk.gdk.pixbuf_new_from_inline(len(new_checkmark), new_checkmark, False) >+ # load up checkmark >+ self.checkmark_pixbuf = gtk.gdk.pixbuf_new_from_inline(len(new_checkmark), new_checkmark, False) > self.lock_pixbuf = gui.getPixbuf("gnome-lock.png") > > # operational buttons >@@ -1403,7 +1403,7 @@ class PartitionWindow(InstallWindow): > # do the initial population of the tree and the graph > self.populate(initial = 1) > >- vpaned = gtk.VPaned() >+ vpaned = gtk.VPaned() > > hadj = gtk.Adjustment(step_incr = 5.0) > vadj = gtk.Adjustment(step_incr = 5.0) >@@ -1414,25 +1414,25 @@ class PartitionWindow(InstallWindow): > > frame = gtk.Frame() > frame.add(sw) >- vpaned.add1(frame) >+ vpaned.add1(frame) > > box = gtk.VBox(False, 5) > box.pack_start(buttonBox, False) > sw = gtk.ScrolledWindow() > sw.add(self.treeView) > sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) >- sw.set_shadow_type(gtk.SHADOW_IN) >- >+ sw.set_shadow_type(gtk.SHADOW_IN) >+ > box.pack_start(sw, True) > >- self.toggleViewButton = gtk.CheckButton(_("Hide RAID device/LVM Volume _Group members")) >- self.toggleViewButton.set_active(not self.show_uneditable) >- self.toggleViewButton.connect("toggled", self.viewButtonCB) >- box.pack_start(self.toggleViewButton, False, False) >- >- vpaned.add2(box) >+ self.toggleViewButton = gtk.CheckButton(_("Hide RAID device/LVM Volume _Group members")) >+ self.toggleViewButton.set_active(not self.show_uneditable) >+ self.toggleViewButton.connect("toggled", self.viewButtonCB) >+ box.pack_start(self.toggleViewButton, False, False) >+ >+ vpaned.add2(box) > >- # XXX should probably be set according to height >- vpaned.set_position(175) >+ # XXX should probably be set according to height >+ vpaned.set_position(175) > >- return vpaned >+ return vpaned >diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py >index bda0914..203acb5 100644 >--- a/iw/partition_ui_helpers_gui.py >+++ b/iw/partition_ui_helpers_gui.py >@@ -44,17 +44,17 @@ def istruefalse(val): > class WideCheckList(checklist.CheckList): > def toggled_item(self, data, row): > >- rc = True >- if self.clickCB: >- rc = self.clickCB(data, row) >+ rc = True >+ if self.clickCB: >+ rc = self.clickCB(data, row) > >- if rc == True: >- checklist.CheckList.toggled_item(self, data, row) >+ if rc == True: >+ checklist.CheckList.toggled_item(self, data, row) > > > def __init__(self, columns, store, clickCB=None): >- checklist.CheckList.__init__(self, columns=columns, >- custom_store=store) >+ checklist.CheckList.__init__(self, columns=columns, >+ custom_store=store) > > # make checkbox column wider > column = self.get_column(columns) >@@ -63,7 +63,7 @@ class WideCheckList(checklist.CheckList): > column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) > column.set_fixed_width(25) > >- self.clickCB = clickCB >+ self.clickCB = clickCB > > def createAlignedLabel(text): > label = gtk.Label(text) >@@ -78,15 +78,15 @@ def createMountPointCombo(request, excludeMountPoints=[]): > mntptlist = [] > > if request.type != REQUEST_NEW and request.fslabel: >- mntptlist.append(request.fslabel) >+ mntptlist.append(request.fslabel) > idx = 0 > > for p in defaultMountPoints: >- if p in excludeMountPoints: >- continue >- >- if not p in mntptlist and (p[0] == "/"): >- mntptlist.append(p) >+ if p in excludeMountPoints: >+ continue >+ >+ if not p in mntptlist and (p[0] == "/"): >+ mntptlist.append(p) > > map(mountCombo.append_text, mntptlist) > >@@ -138,7 +138,7 @@ def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True, > drives.sort() > for drive in drives: > size = getDeviceSizeMB(disks[drive].dev) >- selected = 0 >+ selected = 0 > > if selectDrives: > if reqdrives: >@@ -148,19 +148,19 @@ def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True, > if drive not in disallowDrives: > selected = 1 > >- sizestr = "%8.0f MB" % size >- drivelist.append_row((drive, sizestr, disks[drive].dev.model), selected) >+ sizestr = "%8.0f MB" % size >+ drivelist.append_row((drive, sizestr, disks[drive].dev.model), selected) > > if len(disks.keys()) < 2: >- drivelist.set_sensitive(False) >+ drivelist.set_sensitive(False) > else: > drivelist.set_sensitive(True) > > def createAllowedDrivesList(disks, reqdrives, selectDrives=True, disallowDrives=[]): > store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING) >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING) > drivelist = WideCheckList(3, store) > createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=selectDrives, > disallowDrives=disallowDrives) >@@ -248,11 +248,11 @@ def formatOptionCB(widget, data): > > # inject event for fstype menu > if widget.get_active(): >- fstype = combowidget.get_active_value() >- setMntPtComboStateFromType(fstype, mntptcombo) >+ fstype = combowidget.get_active_value() >+ setMntPtComboStateFromType(fstype, mntptcombo) > combowidget.grab_focus() > else: >- setMntPtComboStateFromType(ofstype, mntptcombo) >+ setMntPtComboStateFromType(ofstype, mntptcombo) > > def noformatCB(widget, data): > (combowidget, mntptcombo, ofstype) = data >@@ -260,7 +260,7 @@ def noformatCB(widget, data): > > # inject event for fstype menu > if widget.get_active(): >- setMntPtComboStateFromType(ofstype, mntptcombo) >+ setMntPtComboStateFromType(ofstype, mntptcombo) > > > """ createPreExistFSOptionSection: given inputs for a preexisting partition, >@@ -295,7 +295,7 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo, > rc["fstypeCombo"] = fstypeCombo > > if not formatcb.get_active() and not origrequest.migrate: >- mountCombo.set_data("prevmountable", ofstype.isMountable()) >+ mountCombo.set_data("prevmountable", ofstype.isMountable()) > > # this gets added to the table a bit later on > lukscb = gtk.CheckButton(_("_Encrypt")) >@@ -305,24 +305,24 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo, > > > if origrequest.origfstype.isMigratable(): >- migratecb = gtk.CheckButton(label=_("Mi_grate filesystem to:")) >+ migratecb = gtk.CheckButton(label=_("Mi_grate filesystem to:")) > migratecb.set_active(istruefalse(origrequest.migrate)) > >- migtypes = origrequest.origfstype.getMigratableFSTargets() >+ migtypes = origrequest.origfstype.getMigratableFSTargets() > >- maintable.attach(migratecb, 0, 1, row, row + 1) >- migfstypeCombo = createFSTypeMenu(ofstype, None, None, >+ maintable.attach(migratecb, 0, 1, row, row + 1) >+ migfstypeCombo = createFSTypeMenu(ofstype, None, None, > availablefstypes = migtypes) >- migfstypeCombo.set_sensitive(migratecb.get_active()) >- maintable.attach(migfstypeCombo, 1, 2, row, row + 1) >- row = row + 1 >+ migfstypeCombo.set_sensitive(migratecb.get_active()) >+ maintable.attach(migfstypeCombo, 1, 2, row, row + 1) >+ row = row + 1 > rc["migratecb"] = migratecb > rc["migfstypeCombo"] = migfstypeCombo >- migratecb.connect("toggled", formatOptionCB, >+ migratecb.connect("toggled", formatOptionCB, > (migfstypeCombo, mountCombo, ofstype, None)) > else: >- migratecb = None >- migfstypeCombo = None >+ migratecb = None >+ migfstypeCombo = None > > if origrequest.isResizable(partitions): > resizecb = gtk.CheckButton(label=_("_Resize")) >@@ -375,14 +375,14 @@ def doUIRAIDLVMChecks(request, diskset): > numdrives = len(diskset.disks.keys()) > > ## if fstype and fstype.getName() == "physical volume (LVM)": >-## if request.grow: >-## return (_("Partitions of type '%s' must be of fixed size, and " >-## "cannot be marked to fill to use available space.")) % (fstype.getName(),) >+## if request.grow: >+## return (_("Partitions of type '%s' must be of fixed size, and " >+## "cannot be marked to fill to use available space.")) % (fstype.getName(),) > > if fstype and fstype.getName() in ["physical volume (LVM)", "software RAID"]: >- if numdrives > 1 and (request.drive is None or len(request.drive) > 1): >- return (_("Partitions of type '%s' must be constrained to " >- "a single drive. To do this, select the " >- "drive in the 'Allowable Drives' checklist.")) % (fstype.getName(),) >+ if numdrives > 1 and (request.drive is None or len(request.drive) > 1): >+ return (_("Partitions of type '%s' must be constrained to " >+ "a single drive. To do this, select the " >+ "drive in the 'Allowable Drives' checklist.")) % (fstype.getName(),) > > return None >diff --git a/iw/partmethod_gui.py b/iw/partmethod_gui.py >index 8aa7bf5..ed65936 100644 >--- a/iw/partmethod_gui.py >+++ b/iw/partmethod_gui.py >@@ -30,7 +30,7 @@ _ = lambda x: gettext.ldgettext("anaconda", x) > > class PartitionMethodWindow(InstallWindow): > def __init__(self, ics): >- InstallWindow.__init__(self, ics) >+ InstallWindow.__init__(self, ics) > ics.setTitle (_("Disk Partitioning Setup")) > > def getNext(self): >@@ -40,7 +40,7 @@ class PartitionMethodWindow(InstallWindow): > else: > self.partitions.useAutopartitioning = 0 > >- return None >+ return None > > def getScreen (self, partitions, instclass): > self.partitions = partitions >@@ -57,23 +57,23 @@ class PartitionMethodWindow(InstallWindow): > > self.useAuto = gtk.RadioButton( > None, _("_Automatically partition")) >- radioBox.pack_start(self.useAuto, False, False) >+ radioBox.pack_start(self.useAuto, False, False) > self.useDS = gtk.RadioButton( > self.useAuto, _("Manually partition with _Disk Druid")) >- radioBox.pack_start(self.useDS, False, False) >+ radioBox.pack_start(self.useDS, False, False) > > if partitions.useAutopartitioning: > self.useAuto.set_active(1) > else: > self.useDS.set_active(1) > >- align = gtk.Alignment() >- align.add(radioBox) >- align.set(0.5, 0.5, 0.0, 0.0) >+ align = gtk.Alignment() >+ align.add(radioBox) >+ align.set(0.5, 0.5, 0.0, 0.0) > >- box.pack_start(align, False, False, 10) >+ box.pack_start(align, False, False, 10) > >- box.set_border_width (5) >+ box.set_border_width (5) > > self.ics.setNextEnabled (True) > >@@ -81,4 +81,4 @@ class PartitionMethodWindow(InstallWindow): > align.add(box) > align.set(0.5, 0.5, 0.0, 0.0) > >- return align >+ return align >diff --git a/iw/pixmapRadioButtonGroup_gui.py b/iw/pixmapRadioButtonGroup_gui.py >index 89c4bb4..3c9b342 100644 >--- a/iw/pixmapRadioButtonGroup_gui.py >+++ b/iw/pixmapRadioButtonGroup_gui.py >@@ -24,17 +24,17 @@ from constants import * > class pixmapRadioButtonGroup: > > def toggled (self, widget): >- if self.togglecb is not None: >- >- name = None >- for b in self.buttonToEntry.keys(): >- if b == widget: >- name = self.buttonToEntry[b] >- >- self.togglecb(widget, name) >- >+ if self.togglecb is not None: >+ >+ name = None >+ for b in self.buttonToEntry.keys(): >+ if b == widget: >+ name = self.buttonToEntry[b] >+ >+ self.togglecb(widget, name) >+ > # if not widget.get_active (): >-# return >+# return > > # > # expects a gtk pixmap for pixmap >@@ -42,43 +42,43 @@ class pixmapRadioButtonGroup: > def pixRadioButton (self, group, labelstr, pixmap, description=None): > pix = pixmap > >- hbox = gtk.HBox (False, 18) >- if pix != None: >- hbox.pack_start (pix, True, True, 0) >+ hbox = gtk.HBox (False, 18) >+ if pix != None: >+ hbox.pack_start (pix, True, True, 0) > >- label = gtk.Label("") >- label.set_line_wrap(True) >- label.set_markup("<b>"+labelstr+"</b>") >- label.set_alignment (0.0, 0.5) >- if description is not None: >- label.set_markup ("<b>%s</b>\n<small>%s</small>" %(labelstr, >+ label = gtk.Label("") >+ label.set_line_wrap(True) >+ label.set_markup("<b>"+labelstr+"</b>") >+ label.set_alignment (0.0, 0.5) >+ if description is not None: >+ label.set_markup ("<b>%s</b>\n<small>%s</small>" %(labelstr, > description)) >- label.set_line_wrap(True) >- if gtk.gdk.screen_width() > 640: >- wraplen = 350 >- else: >- wraplen = 250 >- >- label.set_size_request(wraplen, -1) >- label.set_use_markup (True) >- label.set_use_underline(True) >- >- hbox.pack_start (label, True, True, 0) >- button = gtk.RadioButton (group) >- button.add (hbox) >- label.set_mnemonic_widget(button) >+ label.set_line_wrap(True) >+ if gtk.gdk.screen_width() > 640: >+ wraplen = 350 >+ else: >+ wraplen = 250 >+ >+ label.set_size_request(wraplen, -1) >+ label.set_use_markup (True) >+ label.set_use_underline(True) >+ >+ hbox.pack_start (label, True, True, 0) >+ button = gtk.RadioButton (group) >+ button.add (hbox) >+ label.set_mnemonic_widget(button) > return button > > # add a entry to end of list > # (label and descr should already be passed through _()) > def addEntry(self, name, label, pixmap=None, descr=None, userdata=None): >- node = {} >- node["name"] = name >- node["label"] = label >- node["descr"] = descr >- node["pixmap"] = pixmap >- node["userdata"] = userdata >- self.entries.append(node) >+ node = {} >+ node["name"] = name >+ node["label"] = label >+ node["descr"] = descr >+ node["pixmap"] = pixmap >+ node["userdata"] = userdata >+ self.entries.append(node) > > # > # finds entry matching name and makes it current >@@ -86,11 +86,11 @@ class pixmapRadioButtonGroup: > # MUST call AFTER calling render, since widgets are not created yet otherwise > # > def setCurrent(self, name): >- for b in self.buttonToEntry.keys(): >- if self.buttonToEntry[b] == name: >- b.set_active(1) >+ for b in self.buttonToEntry.keys(): >+ if self.buttonToEntry[b] == name: >+ b.set_active(1) > >- >+ > > # > # returns name of current selection >@@ -98,114 +98,114 @@ class pixmapRadioButtonGroup: > # MUST call AFTER calling render, since widgets are not created yet otherwise > # > def getCurrent(self): >- for b in self.buttonToEntry.keys(): >- if b.get_active(): >- return self.buttonToEntry[b] >+ for b in self.buttonToEntry.keys(): >+ if b.get_active(): >+ return self.buttonToEntry[b] > > > # > # MUST call AFTER calling render, since widgets are not created yet otherwise > # > def packWidgetInEntry(self, name, widget): >- # find button for name >- for b in self.buttonToEntry.keys(): >- if self.buttonToEntry[b] == name: >- # now find box for button >- for (button, box, buttons) in self.topLevelButtonList: >- if button == b: >- box.pack_end(widget) >- return >+ # find button for name >+ for b in self.buttonToEntry.keys(): >+ if self.buttonToEntry[b] == name: >+ # now find box for button >+ for (button, box, buttons) in self.topLevelButtonList: >+ if button == b: >+ box.pack_end(widget) >+ return > > def setToggleCallback(self, cb): >- self.togglecb = cb >- >+ self.togglecb = cb >+ > # render resulting list, returns a box you can pack > # > # call this after adding all parents and nodes > def render(self): > >- radioGroup = None >- buttons = [] >- for item in self.entries: >- box = gtk.VBox (False, 9) >- name = item["name"] >- label = item["label"] >- pixmap = item["pixmap"] >- descr = item["descr"] >- radioGroup = self.pixRadioButton(radioGroup, label, pixmap, >- description=descr) >- buttons.append(radioGroup) >- self.buttonToEntry[radioGroup] = name >- >- self.topLevelButtonList.append((radioGroup, box, buttons)) >- radioGroup.connect("toggled", self.toggled) >- >- finalVBox = gtk.VBox(False, 18) >- finalVBox.set_border_width (5) >- >- for (button, box, buttons) in self.topLevelButtonList: >- vbox = gtk.VBox (False, 9) >- finalVBox.pack_start(vbox, False, False) >- vbox.pack_start (button, False, False) >- >- if box: >- tmphbox = gtk.HBox(False) >- >- crackhbox = gtk.HBox(False) >- crackhbox.set_size_request(50, -1) >- >- tmphbox.pack_start(crackhbox, False, False) >- tmphbox.pack_start(box, True, True) >- vbox.pack_start(tmphbox, False, False) >- >+ radioGroup = None >+ buttons = [] >+ for item in self.entries: >+ box = gtk.VBox (False, 9) >+ name = item["name"] >+ label = item["label"] >+ pixmap = item["pixmap"] >+ descr = item["descr"] >+ radioGroup = self.pixRadioButton(radioGroup, label, pixmap, >+ description=descr) >+ buttons.append(radioGroup) >+ self.buttonToEntry[radioGroup] = name >+ >+ self.topLevelButtonList.append((radioGroup, box, buttons)) >+ radioGroup.connect("toggled", self.toggled) >+ >+ finalVBox = gtk.VBox(False, 18) >+ finalVBox.set_border_width (5) >+ >+ for (button, box, buttons) in self.topLevelButtonList: >+ vbox = gtk.VBox (False, 9) >+ finalVBox.pack_start(vbox, False, False) >+ vbox.pack_start (button, False, False) >+ >+ if box: >+ tmphbox = gtk.HBox(False) >+ >+ crackhbox = gtk.HBox(False) >+ crackhbox.set_size_request(50, -1) >+ >+ tmphbox.pack_start(crackhbox, False, False) >+ tmphbox.pack_start(box, True, True) >+ vbox.pack_start(tmphbox, False, False) >+ > return finalVBox > > > # InstallPathWindow tag="instpath" > def __init__(self): >- self.entries = [] >- self.topLevelButtonList = [] >- self.buttonToEntry = {} >- self.togglecb = None >+ self.entries = [] >+ self.topLevelButtonList = [] >+ self.buttonToEntry = {} >+ self.togglecb = None > > > if __name__ == "__main__": > def readPixmap(fn): >- pixbuf = gtk.gdk.pixbuf_new_from_file(fn) >+ pixbuf = gtk.gdk.pixbuf_new_from_file(fn) > >- source = gtk.IconSource() >- source.set_pixbuf(pixbuf) >- source.set_size(gtk.ICON_SIZE_DIALOG) >- source.set_size_wildcarded(False) >- iconset = gtk.IconSet() >- iconset.add_source(source) >- p = gtk.image_new_from_icon_set(iconset, gtk.ICON_SIZE_DIALOG) >+ source = gtk.IconSource() >+ source.set_pixbuf(pixbuf) >+ source.set_size(gtk.ICON_SIZE_DIALOG) >+ source.set_size_wildcarded(False) >+ iconset = gtk.IconSet() >+ iconset.add_source(source) >+ p = gtk.image_new_from_icon_set(iconset, gtk.ICON_SIZE_DIALOG) > >- return p >+ return p > > def nowquit(widget): >- global r >+ global r > >- print "selection -> ",r.getCurrent() >+ print "selection -> ",r.getCurrent() > >- gtk.mainquit() >- >+ gtk.mainquit() >+ > win = gtk.Window() > win.connect('destroy', nowquit) > > > if 0: >- opts = ['8.0 - /dev/hda1', '7.1 - /dev/hda5'] >+ opts = ['8.0 - /dev/hda1', '7.1 - /dev/hda5'] > else: >- opts = ['8.0 - /dev/hda1'] >+ opts = ['8.0 - /dev/hda1'] > > label = "The following installed system will be upgraded:" > upgradeoption = gtk.OptionMenu() > upgradeoptionmenu = gtk.Menu() > for lev in opts: >- item = gtk.MenuItem(lev) >- item.show() >- upgradeoptionmenu.add(item) >+ item = gtk.MenuItem(lev) >+ item.show() >+ upgradeoptionmenu.add(item) > > upboxtmp = gtk.VBox(False, 5) > l = gtk.Label(label) >@@ -229,7 +229,7 @@ if __name__ == "__main__": > r.addEntry("upgrade", "_Upgrade Existing Installation", pixmap=readPixmap("/usr/share/anaconda/pixmaps/upgrade.png"), descr="Choose this option if you would like to upgrade your existing %s system. This option will preserve the data on your drive" % (productName,), userdata="data") > > r.addEntry("install", "_Reinstall %s" %(productName,), pixmap=readPixmap("../pixmaps/install.png"), >- descr="Choose this option to reinstall your system. Depending on how you partition your system, your previous data may be lost.", userdata="data2") >+ descr="Choose this option to reinstall your system. Depending on how you partition your system, your previous data may be lost.", userdata="data2") > b = r.render() > r.setCurrent("Don't Upgrade") > >diff --git a/iw/progress_gui.py b/iw/progress_gui.py >index 4b3499f..bae353e 100644 >--- a/iw/progress_gui.py >+++ b/iw/progress_gui.py >@@ -37,7 +37,7 @@ class InstallProgressWindow (InstallWindow): > windowTitle = N_("Installing Packages") > > def __init__ (self, ics): >- InstallWindow.__init__ (self, ics) >+ InstallWindow.__init__ (self, ics) > ics.setPrevEnabled (False) > ics.setNextEnabled (False) > >@@ -112,14 +112,14 @@ class InstallProgressWindow (InstallWindow): > > > def getScreen (self, anaconda): >- self.intf = anaconda.intf >- if anaconda.dir == DISPATCH_BACK: >- self.intf.icw.prevClicked() >- return >+ self.intf = anaconda.intf >+ if anaconda.dir == DISPATCH_BACK: >+ self.intf.icw.prevClicked() >+ return > > self.pixmaps = self._getRnotes() > >- # Create vbox to contain components of UI >+ # Create vbox to contain components of UI > vbox = gtk.VBox (False, 12) > > # Create rnote area >@@ -137,17 +137,17 @@ class InstallProgressWindow (InstallWindow): > vbox.pack_start(frame, False) > > >- self.progress = gtk.ProgressBar() >+ self.progress = gtk.ProgressBar() > vbox.pack_start(self.progress, False) > > self.infolabel = gui.WrappingLabel("") > self.infolabel.set_alignment(0,0) > vbox.pack_start(self.infolabel) > >- # All done with creating components of UI >- self.intf.setPackageProgressWindow(self) >- anaconda.id.setInstallProgressClass(self) >+ # All done with creating components of UI >+ self.intf.setPackageProgressWindow(self) >+ anaconda.id.setInstallProgressClass(self) > >- vbox.set_border_width(6) >+ vbox.set_border_width(6) > >- return vbox >+ return vbox >diff --git a/iw/raid_dialog_gui.py b/iw/raid_dialog_gui.py >index 1e300d1..b5a7cc1 100644 >--- a/iw/raid_dialog_gui.py >+++ b/iw/raid_dialog_gui.py >@@ -43,15 +43,15 @@ class RaidEditor: > def createAllowedRaidPartitionsList(self, allraidparts, reqraidpart, > preexist): > >- store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING) >- partlist = WideCheckList(2, store) >+ store = gtk.TreeStore(gobject.TYPE_BOOLEAN, >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING) >+ partlist = WideCheckList(2, store) > >- sw = gtk.ScrolledWindow() >- sw.add(partlist) >- sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >- sw.set_shadow_type(gtk.SHADOW_IN) >+ sw = gtk.ScrolledWindow() >+ sw.add(partlist) >+ sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >+ sw.set_shadow_type(gtk.SHADOW_IN) > > tempDevList = [] > if not self.isNew: >@@ -59,10 +59,10 @@ class RaidEditor: > for id in reqraidpart: > tempDevList.append(self.partitions.getRequestByID(id).device) > >- partrow = 0 >- for part, size, used in allraidparts: >- partname = "%s" % part >- partsize = "%8.0f MB" % size >+ partrow = 0 >+ for part, size, used in allraidparts: >+ partname = "%s" % part >+ partsize = "%8.0f MB" % size > > if self.isNew: > partlist.append_row((partname, partsize), False) >@@ -72,103 +72,103 @@ class RaidEditor: > #list the partition and put it as selected > partlist.append_row((partname, partsize), True) > >- return (partlist, sw) >+ return (partlist, sw) > > def createRaidLevelMenu(self, levels, reqlevel): > levelcombo = gtk.combo_box_new_text() >- defindex = 0 >+ defindex = 0 > if "RAID1" in levels: > defindex = levels.index("RAID1") >- i = 0 >- for lev in levels: >+ i = 0 >+ for lev in levels: > levelcombo.append_text(lev) > >- if reqlevel and lev == reqlevel: >- defindex = i >- i = i + 1 >+ if reqlevel and lev == reqlevel: >+ defindex = i >+ i = i + 1 > > levelcombo.set_active(defindex) > >- if reqlevel and reqlevel == "RAID0": >- self.sparesb.set_sensitive(0) >+ if reqlevel and reqlevel == "RAID0": >+ self.sparesb.set_sensitive(0) > > if self.sparesb: > levelcombo.connect("changed", self.raidlevelchangeCB, self.sparesb) > >- return levelcombo >+ return levelcombo > > def createRaidMinorMenu(self, minors, reqminor): > minorcombo = datacombo.DataComboBox() >- defindex = 0 >- i = 0 >- for minor in minors: >+ defindex = 0 >+ i = 0 >+ for minor in minors: > minorcombo.append("md%d" %(minor,), minor) >- if reqminor and minor == reqminor: >- defindex = i >- i = i + 1 >+ if reqminor and minor == reqminor: >+ defindex = i >+ i = i + 1 > > minorcombo.set_active(defindex) > >- return minorcombo >+ return minorcombo > > > def raidlevelchangeCB(self, widget, sparesb): >- raidlevel = widget.get_model()[widget.get_active()][0] >- numparts = sparesb.get_data("numparts") >- maxspares = raid.get_raid_max_spares(raidlevel, numparts) >- >- if maxspares > 0 and raidlevel != "RAID0": >- adj = sparesb.get_adjustment() >- value = adj.value >- if adj.value > maxspares: >- value = maxspares >- >- sparesb.set_sensitive(1) >- spareAdj = gtk.Adjustment(value = value, lower = 0, >- upper = maxspares, step_incr = 1) >- spareAdj.clamp_page(0, maxspares) >- sparesb.set_adjustment(spareAdj) >- sparesb.set_value(value) >- else: >- sparesb.set_value(0) >- sparesb.set_sensitive(0) >+ raidlevel = widget.get_model()[widget.get_active()][0] >+ numparts = sparesb.get_data("numparts") >+ maxspares = raid.get_raid_max_spares(raidlevel, numparts) >+ >+ if maxspares > 0 and raidlevel != "RAID0": >+ adj = sparesb.get_adjustment() >+ value = adj.value >+ if adj.value > maxspares: >+ value = maxspares >+ >+ sparesb.set_sensitive(1) >+ spareAdj = gtk.Adjustment(value = value, lower = 0, >+ upper = maxspares, step_incr = 1) >+ spareAdj.clamp_page(0, maxspares) >+ sparesb.set_adjustment(spareAdj) >+ sparesb.set_value(value) >+ else: >+ sparesb.set_value(0) >+ sparesb.set_sensitive(0) > > def run(self): >- if self.dialog is None: >- return None >- >- while 1: >- rc = self.dialog.run() >- >- # user hit cancel, do nothing >- if rc == 2: >- self.destroy() >- return None >- >- # read out UI into a partition specification >- request = copy.copy(self.origrequest) >+ if self.dialog is None: >+ return None >+ >+ while 1: >+ rc = self.dialog.run() >+ >+ # user hit cancel, do nothing >+ if rc == 2: >+ self.destroy() >+ return None >+ >+ # read out UI into a partition specification >+ request = copy.copy(self.origrequest) > request.encryption = copy.deepcopy(self.origrequest.encryption) > >- # doesn't make sense for RAID device >+ # doesn't make sense for RAID device > if not self.origrequest.getPreExisting(): > filesystem = self.fstypeCombo.get_active_value() > request.fstype = filesystem > >- if request.fstype.isMountable(): >- request.mountpoint = self.mountCombo.get_children()[0].get_text() >- else: >- request.mountpoint = None >+ if request.fstype.isMountable(): >+ request.mountpoint = self.mountCombo.get_children()[0].get_text() >+ else: >+ request.mountpoint = None > >- raidmembers = [] >- model = self.raidlist.get_model() >- iter = model.get_iter_first() >- while iter: >- val = model.get_value(iter, 0) >- part = model.get_value(iter, 1) >+ raidmembers = [] >+ model = self.raidlist.get_model() >+ iter = model.get_iter_first() >+ while iter: >+ val = model.get_value(iter, 0) >+ part = model.get_value(iter, 1) > >- if val: >- req = self.partitions.getRequestByDeviceName(part) >- raidmembers.append(req.uniqueID) >+ if val: >+ req = self.partitions.getRequestByDeviceName(part) >+ raidmembers.append(req.uniqueID) > > iter = model.iter_next(iter) > >@@ -185,10 +185,10 @@ class RaidEditor: > else: > request.raidspares = 0 > >- if self.formatButton: >- request.format = self.formatButton.get_active() >- else: >- request.format = 0 >+ if self.formatButton: >+ request.format = self.formatButton.get_active() >+ else: >+ request.format = 0 > > if self.lukscb and self.lukscb.get_active(): > if request.encryption: >@@ -218,23 +218,23 @@ class RaidEditor: > self.partitions.globalPassphrase = passphrase > else: > request.encryption = None >- else: >- if self.fsoptionsDict.has_key("formatcb"): >+ else: >+ if self.fsoptionsDict.has_key("formatcb"): > request.format = self.fsoptionsDict["formatcb"].get_active() > if request.format: > request.fsystem = self.fsoptionsDict["fstypeCombo"].get_active_value() > else: > request.format = 0 > >- if self.fsoptionsDict.has_key("migratecb"): >- request.migrate = self.fsoptionsDict["migratecb"].get_active() >+ if self.fsoptionsDict.has_key("migratecb"): >+ request.migrate = self.fsoptionsDict["migratecb"].get_active() > if request.migrate: > request.fsystem = self.fsoptionsDict["migfstypeCombo"].get_active_value() > else: > request.migrate = 0 > > # set back if we are not formatting or migrating >- origfstype = self.origrequest.origfstype >+ origfstype = self.origrequest.origfstype > if not request.format and not request.migrate: > request.fstype = origfstype > >@@ -273,93 +273,93 @@ class RaidEditor: > else: > request.encryption = None > >- err = request.sanityCheckRequest(self.partitions) >- if err: >- self.intf.messageWindow(_("Error With Request"), >- "%s" % (err), custom_icon="error") >- continue >+ err = request.sanityCheckRequest(self.partitions) >+ if err: >+ self.intf.messageWindow(_("Error With Request"), >+ "%s" % (err), custom_icon="error") >+ continue > >- if (not request.format and >- request.mountpoint and request.formatByDefault()): >- if not queryNoFormatPreExisting(self.intf): >- continue >+ if (not request.format and >+ request.mountpoint and request.formatByDefault()): >+ if not queryNoFormatPreExisting(self.intf): >+ continue > >- # everything ok, break out >- break >+ # everything ok, break out >+ break > > >- return request >+ return request > > def destroy(self): >- if self.dialog: >- self.dialog.destroy() >+ if self.dialog: >+ self.dialog.destroy() > >- self.dialog = None >- >+ self.dialog = None >+ > def __init__(self, partitions, diskset, intf, parent, origrequest, isNew = 0): >- self.partitions = partitions >- self.diskset = diskset >- self.origrequest = origrequest >- self.isNew = isNew >- self.intf = intf >- self.parent = parent >- >- self.dialog = None >- >- # >- # start of editRaidRequest >- # >- availraidparts = self.partitions.getAvailRaidPartitions(origrequest, >- self.diskset) >- # if no raid partitions exist, raise an error message and return >- if len(availraidparts) < 2: >- dlg = gtk.MessageDialog(self.parent, 0, gtk.MESSAGE_ERROR, >- gtk.BUTTONS_OK, >- _("At least two unused software RAID " >- "partitions are needed to create " >- "a RAID device.\n\n" >- "First create at least two partitions " >- "of type \"software RAID\", and then " >- "select the \"RAID\" option again.")) >- gui.addFrame(dlg) >- dlg.show_all() >- dlg.set_position(gtk.WIN_POS_CENTER) >- dlg.run() >- dlg.destroy() >- return >- >- if isNew: >- tstr = _("Make RAID Device") >- else: >- try: >- tstr = _("Edit RAID Device: /dev/md%s") % (origrequest.raidminor,) >- except: >- tstr = _("Edit RAID Device") >- >- dialog = gtk.Dialog(tstr, self.parent) >- gui.addFrame(dialog) >- dialog.add_button('gtk-cancel', 2) >- dialog.add_button('gtk-ok', 1) >- dialog.set_position(gtk.WIN_POS_CENTER) >- >- maintable = gtk.Table() >- maintable.set_row_spacings(5) >- maintable.set_col_spacings(5) >- row = 0 >- >- # Mount Point entry >- lbl = createAlignedLabel(_("_Mount Point:")) >- maintable.attach(lbl, 0, 1, row, row + 1) >- self.mountCombo = createMountPointCombo(origrequest) >- lbl.set_mnemonic_widget(self.mountCombo) >- maintable.attach(self.mountCombo, 1, 2, row, row + 1) >- row = row + 1 >+ self.partitions = partitions >+ self.diskset = diskset >+ self.origrequest = origrequest >+ self.isNew = isNew >+ self.intf = intf >+ self.parent = parent >+ >+ self.dialog = None >+ >+ # >+ # start of editRaidRequest >+ # >+ availraidparts = self.partitions.getAvailRaidPartitions(origrequest, >+ self.diskset) >+ # if no raid partitions exist, raise an error message and return >+ if len(availraidparts) < 2: >+ dlg = gtk.MessageDialog(self.parent, 0, gtk.MESSAGE_ERROR, >+ gtk.BUTTONS_OK, >+ _("At least two unused software RAID " >+ "partitions are needed to create " >+ "a RAID device.\n\n" >+ "First create at least two partitions " >+ "of type \"software RAID\", and then " >+ "select the \"RAID\" option again.")) >+ gui.addFrame(dlg) >+ dlg.show_all() >+ dlg.set_position(gtk.WIN_POS_CENTER) >+ dlg.run() >+ dlg.destroy() >+ return >+ >+ if isNew: >+ tstr = _("Make RAID Device") >+ else: >+ try: >+ tstr = _("Edit RAID Device: /dev/md%s") % (origrequest.raidminor,) >+ except: >+ tstr = _("Edit RAID Device") >+ >+ dialog = gtk.Dialog(tstr, self.parent) >+ gui.addFrame(dialog) >+ dialog.add_button('gtk-cancel', 2) >+ dialog.add_button('gtk-ok', 1) >+ dialog.set_position(gtk.WIN_POS_CENTER) >+ >+ maintable = gtk.Table() >+ maintable.set_row_spacings(5) >+ maintable.set_col_spacings(5) >+ row = 0 >+ >+ # Mount Point entry >+ lbl = createAlignedLabel(_("_Mount Point:")) >+ maintable.attach(lbl, 0, 1, row, row + 1) >+ self.mountCombo = createMountPointCombo(origrequest) >+ lbl.set_mnemonic_widget(self.mountCombo) >+ maintable.attach(self.mountCombo, 1, 2, row, row + 1) >+ row = row + 1 > > # we'll maybe add this further down > self.lukscb = gtk.CheckButton(_("_Encrypt")) > self.lukscb.set_data("formatstate", 1) > >- # Filesystem Type >+ # Filesystem Type > if not origrequest.getPreExisting(): > lbl = createAlignedLabel(_("_File System Type:")) > maintable.attach(lbl, 0, 1, row, row + 1) >@@ -367,7 +367,7 @@ class RaidEditor: > fstypechangeCB, > self.mountCombo, > ignorefs = ["software RAID", "efi", "PPC PReP Boot", "Apple Bootstrap"]) >- lbl.set_mnemonic_widget(self.fstypeCombo) >+ lbl.set_mnemonic_widget(self.fstypeCombo) > maintable.attach(self.fstypeCombo, 1, 2, row, row + 1) > row += 1 > else: >@@ -389,9 +389,9 @@ class RaidEditor: > row + 1) > row += 1 > >- # raid minors >- lbl = createAlignedLabel(_("RAID _Device:")) >- maintable.attach(lbl, 0, 1, row, row + 1) >+ # raid minors >+ lbl = createAlignedLabel(_("RAID _Device:")) >+ maintable.attach(lbl, 0, 1, row, row + 1) > > if not origrequest.getPreExisting(): > availminors = self.partitions.getAvailableRaidMinors()[:16] >@@ -401,15 +401,15 @@ class RaidEditor: > > availminors.sort() > self.minorCombo = self.createRaidMinorMenu(availminors, reqminor) >- lbl.set_mnemonic_widget(self.minorCombo) >+ lbl.set_mnemonic_widget(self.minorCombo) > else: > self.minorCombo = gtk.Label("md%s" %(origrequest.raidminor,)) >- maintable.attach(self.minorCombo, 1, 2, row, row + 1) >- row = row + 1 >+ maintable.attach(self.minorCombo, 1, 2, row, row + 1) >+ row = row + 1 > >- # raid level >- lbl = createAlignedLabel(_("RAID _Level:")) >- maintable.attach(lbl, 0, 1, row, row + 1) >+ # raid level >+ lbl = createAlignedLabel(_("RAID _Level:")) >+ maintable.attach(lbl, 0, 1, row, row + 1) > > if not origrequest.getPreExisting(): > # Create here, pack below >@@ -441,46 +441,46 @@ class RaidEditor: > if not origrequest.getPreExisting(): > self.levelcombo = self.createRaidLevelMenu(availRaidLevels, > origrequest.raidlevel) >- lbl.set_mnemonic_widget(self.levelcombo) >+ lbl.set_mnemonic_widget(self.levelcombo) > else: > self.levelcombo = gtk.Label(origrequest.raidlevel) > >- maintable.attach(self.levelcombo, 1, 2, row, row + 1) >- row = row + 1 >+ maintable.attach(self.levelcombo, 1, 2, row, row + 1) >+ row = row + 1 > >- # raid members >- lbl=createAlignedLabel(_("_RAID Members:")) >- maintable.attach(lbl, 0, 1, row, row + 1) >+ # raid members >+ lbl=createAlignedLabel(_("_RAID Members:")) >+ maintable.attach(lbl, 0, 1, row, row + 1) > >- # XXX need to pass in currently used partitions for this device >- (self.raidlist, sw) = self.createAllowedRaidPartitionsList(availraidparts, >+ # XXX need to pass in currently used partitions for this device >+ (self.raidlist, sw) = self.createAllowedRaidPartitionsList(availraidparts, > origrequest.raidmembers, > origrequest.getPreExisting()) > >- lbl.set_mnemonic_widget(self.raidlist) >- self.raidlist.set_size_request(275, 80) >- maintable.attach(sw, 1, 2, row, row + 1) >- row = row + 1 >+ lbl.set_mnemonic_widget(self.raidlist) >+ self.raidlist.set_size_request(275, 80) >+ maintable.attach(sw, 1, 2, row, row + 1) >+ row = row + 1 > > if origrequest.getPreExisting(): > self.raidlist.set_sensitive(False) > >- # number of spares - created widget above >- lbl = createAlignedLabel(_("Number of _spares:")) >- maintable.attach(lbl, 0, 1, row, row + 1) >- maintable.attach(self.sparesb, 1, 2, row, row + 1) >- lbl.set_mnemonic_widget(self.sparesb) >- row = row + 1 >- >- # format or not? >- self.formatButton = None >- self.fsoptionsDict = {} >- if (origrequest.fstype and origrequest.fstype.isFormattable()) and not origrequest.getPreExisting(): >- self.formatButton = gtk.CheckButton(_("_Format partition?")) >- if origrequest.format == None or origrequest.format != 0: >- self.formatButton.set_active(1) >- else: >- self.formatButton.set_active(0) >+ # number of spares - created widget above >+ lbl = createAlignedLabel(_("Number of _spares:")) >+ maintable.attach(lbl, 0, 1, row, row + 1) >+ maintable.attach(self.sparesb, 1, 2, row, row + 1) >+ lbl.set_mnemonic_widget(self.sparesb) >+ row = row + 1 >+ >+ # format or not? >+ self.formatButton = None >+ self.fsoptionsDict = {} >+ if (origrequest.fstype and origrequest.fstype.isFormattable()) and not origrequest.getPreExisting(): >+ self.formatButton = gtk.CheckButton(_("_Format partition?")) >+ if origrequest.format == None or origrequest.format != 0: >+ self.formatButton.set_active(1) >+ else: >+ self.formatButton.set_active(0) > # it only makes sense to show this for preexisting RAID > if origrequest.getPreExisting(): > maintable.attach(self.formatButton, 0, 2, row, row + 1) >@@ -493,28 +493,28 @@ class RaidEditor: > self.lukscb.set_active(0) > maintable.attach(self.lukscb, 0, 2, row, row + 1) > row = row + 1 >- else: >- (row, self.fsoptionsDict) = createPreExistFSOptionSection(self.origrequest, maintable, row, self.mountCombo, self.partitions) >+ else: >+ (row, self.fsoptionsDict) = createPreExistFSOptionSection(self.origrequest, maintable, row, self.mountCombo, self.partitions) > >- # put main table into dialog >- dialog.vbox.pack_start(maintable) >+ # put main table into dialog >+ dialog.vbox.pack_start(maintable) > >- dialog.show_all() >- self.dialog = dialog >- return >+ dialog.show_all() >+ self.dialog = dialog >+ return > > > > class RaidCloneDialog: > def createDriveList(self, diskset): > >- store = gtk.ListStore(gobject.TYPE_STRING) >+ store = gtk.ListStore(gobject.TYPE_STRING) > view = gtk.TreeView(store) > >- sw = gtk.ScrolledWindow() >- sw.add(view) >- sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >- sw.set_shadow_type(gtk.SHADOW_IN) >+ sw = gtk.ScrolledWindow() >+ sw.add(view) >+ sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >+ sw.set_shadow_type(gtk.SHADOW_IN) > > drives = diskset.disks.keys() > drives.sort() >@@ -533,8 +533,8 @@ class RaidCloneDialog: > def getInterestingRequestsForDrive(self, drive): > allrequests = self.partitions.getRequestsByDevice(self.diskset, drive) > >- if allrequests is None or len(allrequests) == 0: >- return allrequests >+ if allrequests is None or len(allrequests) == 0: >+ return allrequests > > # remove extended partitions > requests = [] >@@ -545,15 +545,15 @@ class RaidCloneDialog: > except: > part = None > >- if part: >- if part.type & parted.PARTITION_EXTENDED: >- continue >- elif part.type & parted.PARTITION_FREESPACE: >- continue >- elif part.type & parted.PARTITION_METADATA: >- continue >- else: >- continue >+ if part: >+ if part.type & parted.PARTITION_EXTENDED: >+ continue >+ elif part.type & parted.PARTITION_FREESPACE: >+ continue >+ elif part.type & parted.PARTITION_METADATA: >+ continue >+ else: >+ continue > > requests.append(req) > >@@ -568,7 +568,7 @@ class RaidCloneDialog: > "'software RAID' on this drive before it can be cloned.") > if requests is None or len(requests) == 0: > self.intf.messageWindow(_("Source Drive Error"), errmsg1, >- custom_icon="error") >+ custom_icon="error") > return 1 > > for req in requests: >@@ -580,7 +580,7 @@ class RaidCloneDialog: > "You must remove these " > "partitions " > "before this drive can be cloned. "), >- custom_icon="error") >+ custom_icon="error") > return 1 > > for req in requests: >@@ -625,9 +625,9 @@ class RaidCloneDialog: > > for drive in self.targetDrives: > requests = self.getInterestingRequestsForDrive(drive) >- if requests is None: >- continue >- >+ if requests is None: >+ continue >+ > for req in requests: > rc = partIntfHelpers.isNotChangable(req, self.partitions) > >@@ -652,47 +652,47 @@ class RaidCloneDialog: > > > def cloneDrive(self): >- # first create list of interesting partitions on the source drive >+ # first create list of interesting partitions on the source drive > requests = self.getInterestingRequestsForDrive(self.sourceDrive) > >- # no requests to clone, bail out >- if requests is None or len(requests) == 0: >- return 0 >- >- # now try to clear the target drives >- for device in self.targetDrives: >- rc = doDeletePartitionsByDevice(self.intf, self.partitions, >- self.diskset, device, >- confirm=0, quiet=1) >- >- # now clone! >- for req in requests: >- for drive in self.targetDrives: >- newreq = copy.copy(req) >- newreq.drive = [drive] >- newreq.uniqueID = None >- newreq.device = None >- newreq.preexist = 0 >- newreq.dev = None >- self.partitions.addRequest(newreq) >- >- return 0 >- >+ # no requests to clone, bail out >+ if requests is None or len(requests) == 0: >+ return 0 >+ >+ # now try to clear the target drives >+ for device in self.targetDrives: >+ rc = doDeletePartitionsByDevice(self.intf, self.partitions, >+ self.diskset, device, >+ confirm=0, quiet=1) >+ >+ # now clone! >+ for req in requests: >+ for drive in self.targetDrives: >+ newreq = copy.copy(req) >+ newreq.drive = [drive] >+ newreq.uniqueID = None >+ newreq.device = None >+ newreq.preexist = 0 >+ newreq.dev = None >+ self.partitions.addRequest(newreq) >+ >+ return 0 >+ > > def targetSelectFunc(self, model, path, iter): > self.targetDrives.append(model.get_value(iter,0)) > > def run(self): >- if self.dialog is None: >- return None >- >- while 1: >- rc = self.dialog.run() >+ if self.dialog is None: >+ return None >+ >+ while 1: >+ rc = self.dialog.run() > >- # user hit cancel, do nothing >- if rc == 2: >- self.destroy() >- return None >+ # user hit cancel, do nothing >+ if rc == 2: >+ self.destroy() >+ return None > > # see what drive they selected as the source > selection = self.sourceView.get_selection() >@@ -700,7 +700,7 @@ class RaidCloneDialog: > if iter is None: > self.intf.messageWindow(_("Error"), > _("Please select a source drive."), >- custom_icon="error") >+ custom_icon="error") > continue > > self.sourceDrive = model.get_value(iter, 0) >@@ -718,56 +718,56 @@ class RaidCloneDialog: > if self.sanityCheckTargetDrives(): > continue > >- # now give them last chance to bail >- msgtxt = _("The drive /dev/%s will now be cloned to the " >- "following drives:\n\n" % (self.sourceDrive,)) >- for drive in self.targetDrives: >- msgtxt = msgtxt + "\t" + "/dev/%s" % (drive,) >- >- msgtxt = msgtxt + _("\n\nWARNING! ALL DATA ON THE TARGET DRIVES " >- "WILL BE DESTROYED.") >- >- rc = self.intf.messageWindow(_("Final Warning"), >- msgtxt, type="custom", >- custom_buttons = ["gtk-cancel", _("Clone Drives")], custom_icon="warning") >- if not rc: >- return 0 >- >- # try to clone now >- ret = self.cloneDrive() >- >- if ret: >- self.intf.messageWindow(_("Error"), >- _("There was an error clearing the " >- "target drives. Cloning failed."), >- custom_icon="error") >- return 0 >- >- # if everything ok, break out >- if not ret: >- break >- >- return 1 >+ # now give them last chance to bail >+ msgtxt = _("The drive /dev/%s will now be cloned to the " >+ "following drives:\n\n" % (self.sourceDrive,)) >+ for drive in self.targetDrives: >+ msgtxt = msgtxt + "\t" + "/dev/%s" % (drive,) >+ >+ msgtxt = msgtxt + _("\n\nWARNING! ALL DATA ON THE TARGET DRIVES " >+ "WILL BE DESTROYED.") >+ >+ rc = self.intf.messageWindow(_("Final Warning"), >+ msgtxt, type="custom", >+ custom_buttons = ["gtk-cancel", _("Clone Drives")], custom_icon="warning") >+ if not rc: >+ return 0 >+ >+ # try to clone now >+ ret = self.cloneDrive() >+ >+ if ret: >+ self.intf.messageWindow(_("Error"), >+ _("There was an error clearing the " >+ "target drives. Cloning failed."), >+ custom_icon="error") >+ return 0 >+ >+ # if everything ok, break out >+ if not ret: >+ break >+ >+ return 1 > > def destroy(self): >- if self.dialog: >- self.dialog.destroy() >+ if self.dialog: >+ self.dialog.destroy() > >- self.dialog = None >- >+ self.dialog = None >+ > def __init__(self, partitions, diskset, intf, parent): >- self.partitions = partitions >- self.diskset = diskset >- self.intf = intf >- self.parent = parent >+ self.partitions = partitions >+ self.diskset = diskset >+ self.intf = intf >+ self.parent = parent > >- self.dialog = None >- self.dialog = gtk.Dialog(_("Make RAID Device"), self.parent) >+ self.dialog = None >+ self.dialog = gtk.Dialog(_("Make RAID Device"), self.parent) > self.dialog.set_size_request(500, 400) >- gui.addFrame(self.dialog) >- self.dialog.add_button('gtk-cancel', 2) >- self.dialog.add_button('gtk-ok', 1) >- self.dialog.set_position(gtk.WIN_POS_CENTER) >+ gui.addFrame(self.dialog) >+ self.dialog.add_button('gtk-cancel', 2) >+ self.dialog.add_button('gtk-ok', 1) >+ self.dialog.set_position(gtk.WIN_POS_CENTER) > > # present list of drives as source > vbox = gtk.VBox() >@@ -812,12 +812,12 @@ class RaidCloneDialog: > frame.add(box) > vbox.pack_start(frame) > >- # put contents into dialog >- self.dialog.vbox.pack_start(vbox) >+ # put contents into dialog >+ self.dialog.vbox.pack_start(vbox) > >- self.dialog.show_all() >+ self.dialog.show_all() > >- return >+ return > > > >diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py >index 2b62909..9998703 100644 >--- a/iw/timezone_gui.py >+++ b/iw/timezone_gui.py >@@ -87,7 +87,7 @@ class TimezoneWindow(InstallWindow): > > # TimezoneWindow tag="timezone" > def getScreen(self, anaconda): >- self.intf = anaconda.intf >+ self.intf = anaconda.intf > self.timezone = anaconda.id.timezone > (self.default, asUTC) = self.timezone.getTimezoneInfo() > >diff --git a/iw/upgrade_migratefs_gui.py b/iw/upgrade_migratefs_gui.py >index bd683b6..2e04ea5 100644 >--- a/iw/upgrade_migratefs_gui.py >+++ b/iw/upgrade_migratefs_gui.py >@@ -30,7 +30,7 @@ import gtk > import gettext > _ = lambda x: gettext.ldgettext("anaconda", x) > >-class UpgradeMigrateFSWindow (InstallWindow): >+class UpgradeMigrateFSWindow (InstallWindow): > windowTitle = N_("Migrate File Systems") > > def getNext (self): >@@ -61,7 +61,7 @@ class UpgradeMigrateFSWindow (InstallWindow): > box = gtk.VBox (False, 5) > box.set_border_width (5) > >- text = (_("This release of %s supports " >+ text = (_("This release of %s supports " > "an updated file system, which has several " > "benefits over the file system traditionally shipped " > "in %s. This installation program can migrate " >@@ -69,7 +69,7 @@ class UpgradeMigrateFSWindow (InstallWindow): > "Which of these partitions would you like to migrate?") % > (productName, productName)) > >- label = gtk.Label (text) >+ label = gtk.Label (text) > label.set_alignment (0.5, 0.0) > label.set_size_request(400, -1) > label.set_line_wrap (True) >diff --git a/iw/upgrade_swap_gui.py b/iw/upgrade_swap_gui.py >index 83e27c6..73469ba 100644 >--- a/iw/upgrade_swap_gui.py >+++ b/iw/upgrade_swap_gui.py >@@ -31,7 +31,7 @@ from constants import * > import gettext > _ = lambda x: gettext.ldgettext("anaconda", x) > >-class UpgradeSwapWindow (InstallWindow): >+class UpgradeSwapWindow (InstallWindow): > windowTitle = N_("Upgrade Swap Partition") > > def getNext (self): >@@ -47,15 +47,15 @@ class UpgradeSwapWindow (InstallWindow): > else: > return None > >- selection = self.view.get_selection() >- (model, iter) = selection.get_selected() >- if iter: >- mnt = model.get_value(iter, 0) >- part = model.get_value(iter, 1) >- size = int(model.get_value(iter, 2)) >+ selection = self.view.get_selection() >+ (model, iter) = selection.get_selected() >+ if iter: >+ mnt = model.get_value(iter, 0) >+ part = model.get_value(iter, 1) >+ size = int(model.get_value(iter, 2)) > val = int(self.entry.get_text()) >- else: >- raise RuntimeError, "unknown value for upgrade swap location" >+ else: >+ raise RuntimeError, "unknown value for upgrade swap location" > > if val > 2000 or val < 1: > rc = self.swapWrongSize() >@@ -92,7 +92,7 @@ class UpgradeSwapWindow (InstallWindow): > box = gtk.VBox (False, 5) > box.set_border_width (5) > >- label = gtk.Label (_("Recent kernels (2.4 or newer) need significantly more " >+ label = gtk.Label (_("Recent kernels (2.4 or newer) need significantly more " > "swap than older kernels, up to twice " > "the amount of RAM on the system. " > "You currently have %dMB of swap configured, but " >@@ -125,37 +125,37 @@ class UpgradeSwapWindow (InstallWindow): > a.add(label) > self.swapbox.pack_start(a, False) > >- self.store = gtk.ListStore(gobject.TYPE_STRING, >- gobject.TYPE_STRING, >- gobject.TYPE_STRING) >+ self.store = gtk.ListStore(gobject.TYPE_STRING, >+ gobject.TYPE_STRING, >+ gobject.TYPE_STRING) > > for (mnt, part, size) in fsList: >- iter = self.store.append() >- self.store.set_value(iter, 0, mnt) >- self.store.set_value(iter, 1, part) >- self.store.set_value(iter, 2, str(size)) >+ iter = self.store.append() >+ self.store.set_value(iter, 0, mnt) >+ self.store.set_value(iter, 1, part) >+ self.store.set_value(iter, 2, str(size)) > >- self.view=gtk.TreeView(self.store) >+ self.view=gtk.TreeView(self.store) > label.set_mnemonic_widget(self.view) > >- i = 0 >- for title in [(_("Mount Point")), (_("Partition")), (_("Free Space (MB)"))]: >- col = gtk.TreeViewColumn(title, gtk.CellRendererText(), text=i) >- self.view.append_column(col) >- i = i + 1 >- >- sw = gtk.ScrolledWindow() >- sw.add(self.view) >- sw.set_shadow_type(gtk.SHADOW_IN) >- sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >- sw.set_size_request(300, 90) >- a = gtk.Alignment(0.5, 0.5) >+ i = 0 >+ for title in [(_("Mount Point")), (_("Partition")), (_("Free Space (MB)"))]: >+ col = gtk.TreeViewColumn(title, gtk.CellRendererText(), text=i) >+ self.view.append_column(col) >+ i = i + 1 >+ >+ sw = gtk.ScrolledWindow() >+ sw.add(self.view) >+ sw.set_shadow_type(gtk.SHADOW_IN) >+ sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) >+ sw.set_size_request(300, 90) >+ a = gtk.Alignment(0.5, 0.5) > a.add(sw) > self.swapbox.pack_start(a, False, True, 10) > >- rootiter = self.store.get_iter_first() >- sel = self.view.get_selection() >- sel.select_iter(rootiter) >+ rootiter = self.store.get_iter_first() >+ sel = self.view.get_selection() >+ sel.select_iter(rootiter) > > label = gtk.Label (_("A minimum swap file size of " > "%d MB is recommended. Please enter a size for the swap " >@@ -208,6 +208,6 @@ class UpgradeSwapWindow (InstallWindow): > > rc = self.intf.messageWindow(_("Warning"), > _("There is not enough space on the device you " >- "selected for the swap partition."), >+ "selected for the swap partition."), > type = "okcancel") > return rc >diff --git a/iw/welcome_gui.py b/iw/welcome_gui.py >index a12a2e1..c59c0b9 100644 >--- a/iw/welcome_gui.py >+++ b/iw/welcome_gui.py >@@ -25,12 +25,12 @@ from constants import * > import gettext > _ = lambda x: gettext.ldgettext("anaconda", x) > >-class WelcomeWindow (InstallWindow): >+class WelcomeWindow (InstallWindow): > > windowTitle = "" #N_("Welcome") > > def __init__ (self, ics): >- InstallWindow.__init__ (self, ics) >+ InstallWindow.__init__ (self, ics) > ics.setGrabNext (1) > > # WelcomeWindow tag="wel" >diff --git a/iw/zipl_gui.py b/iw/zipl_gui.py >index b90eaae..a4a9c27 100644 >--- a/iw/zipl_gui.py >+++ b/iw/zipl_gui.py >@@ -39,7 +39,7 @@ class ZiplWindow (InstallWindow): > def getPrev (self): > # avoid coming back in here if the user backs past and then tries > # to skip this screen >- pass >+ pass > > def getNext (self): > self.bl.args.set(self.kernelEntry.get_text()) >@@ -47,12 +47,12 @@ class ZiplWindow (InstallWindow): > > # ZiplWindow tag="zipl" > def getScreen(self, anaconda): >- self.dispatch = anaconda.dispatch >- self.bl = anaconda.id.bootloader >+ self.dispatch = anaconda.dispatch >+ self.bl = anaconda.id.bootloader > self.intf = anaconda.intf > >- imageList = self.bl.images.getImages() >- defaultDevice = self.bl.images.getDefault() >+ imageList = self.bl.images.getImages() >+ defaultDevice = self.bl.images.getDefault() > self.ignoreSignals = 0 > > box = gtk.VBox(False, 5) >diff --git a/language.py b/language.py >index a853da2..ca0a365 100644 >--- a/language.py >+++ b/language.py >@@ -37,7 +37,7 @@ def expandLangs(astring): > charset = None > # remove charset ... > if '.' in astring: >- langs.append(string.split(astring, '.')[0]) >+ langs.append(string.split(astring, '.')[0]) > > if '@' in astring: > charset = string.split(astring, '@')[1] >@@ -45,7 +45,7 @@ def expandLangs(astring): > # also add 2 character language code ... > if len(astring) > 2: > if charset: langs.append("%s@%s" %(astring[:2], charset)) >- langs.append(astring[:2]) >+ langs.append(astring[:2]) > > return langs > >@@ -142,8 +142,8 @@ class Language: > return self.localeInfo[self.canonLangNick(nick)][0] > > def getFontFile (self, nick): >- # Note: in /etc/fonts.cgz fonts are named by the map >- # name as that's unique, font names are not >+ # Note: in /etc/fonts.cgz fonts are named by the map >+ # name as that's unique, font names are not > font = self.localeInfo[self.canonLangNick(nick)][2] > return font > >@@ -157,13 +157,13 @@ class Language: > return self.nativeLangNames.keys() > > def getCurrentLangSearchList(self): >- return expandLangs(self.getCurrent()) + ['C'] >+ return expandLangs(self.getCurrent()) + ['C'] > > def getCurrent(self): >- if self.targetLang is not None: >- return self.targetLang >- else: >- return self.current >+ if self.targetLang is not None: >+ return self.targetLang >+ else: >+ return self.current > > def getDefault(self): > if self.default: >@@ -176,10 +176,10 @@ class Language: > return 'en_US.UTF-8' > > def setDefault(self, nick): >- self.default = nick >+ self.default = nick > >- dispLang = self.fixLang(self.canonLangNick(nick)) >- self.info['LANG'] = dispLang >+ dispLang = self.fixLang(self.canonLangNick(nick)) >+ self.info['LANG'] = dispLang > > if self.localeInfo[dispLang][2] == "none": > self.info['SYSFONT'] = None >@@ -187,8 +187,8 @@ class Language: > self.info['SYSFONT'] = self.localeInfo[dispLang][2] > > # XXX hack - because of exceptional cases on the var - zh_CN.GB2312 >- if nick == "zh_CN.GB18030": >- self.info['LANGUAGE'] = "zh_CN.GB18030:zh_CN.GB2312:zh_CN" >+ if nick == "zh_CN.GB18030": >+ self.info['LANGUAGE'] = "zh_CN.GB18030:zh_CN.GB2312:zh_CN" > > def setRuntimeDefaults(self, nick): > canonNick = self.fixLang(self.canonLangNick(nick)) >@@ -218,17 +218,17 @@ class Language: > gettext._translations = {} > > def write(self, instPath): >- f = open(instPath + "/etc/sysconfig/i18n", "w") >+ f = open(instPath + "/etc/sysconfig/i18n", "w") > for key in self.info.keys(): > if self.info[key] != None: > if key == "LANG" and self.targetLang is not None: > f.write("%s=\"%s\"\n" % (key, self.targetLang)) > else: > f.write("%s=\"%s\"\n" % (key, self.info[key])) >- f.close() >+ f.close() > > def writeKS(self, f): > if self.targetLang is not None: >- f.write("lang %s\n" % self.targetLang) >+ f.write("lang %s\n" % self.targetLang) > else: >- f.write("lang %s\n" % self.info['LANG']) >+ f.write("lang %s\n" % self.info['LANG']) >diff --git a/lvm.py b/lvm.py >index 70d5108..ae462e3 100644 >--- a/lvm.py >+++ b/lvm.py >@@ -467,9 +467,9 @@ def getPossiblePhysicalExtents(floor=0): > possiblePE = [] > curpe = 8 > while curpe <= 16384*1024: >- if curpe >= floor: >- possiblePE.append(curpe) >- curpe = curpe * 2 >+ if curpe >= floor: >+ possiblePE.append(curpe) >+ curpe = curpe * 2 > > return possiblePE > >@@ -522,16 +522,16 @@ def createSuggestedVGName(partitions): > """ > i = 0 > while 1: >- tmpname = "VolGroup%02d" % (i,) >- if not partitions.isVolumeGroupNameInUse(tmpname): >- break >+ tmpname = "VolGroup%02d" % (i,) >+ if not partitions.isVolumeGroupNameInUse(tmpname): >+ break > >- i = i + 1 >- if i>99: >- tmpname = "" >+ i = i + 1 >+ if i>99: >+ tmpname = "" > > return tmpname >- >+ > def createSuggestedLVName(logreqs): > """Given list of LV requests, come up with a reasonable LV name > >@@ -541,25 +541,25 @@ def createSuggestedLVName(logreqs): > > lnames = [] > for lv in logreqs: >- lnames.append(lv.logicalVolumeName) >+ lnames.append(lv.logicalVolumeName) > > while 1: >- tmpname = "LogVol%02d" % (i,) >- if (logreqs is None) or (tmpname not in lnames): >- break >+ tmpname = "LogVol%02d" % (i,) >+ if (logreqs is None) or (tmpname not in lnames): >+ break > >- i = i + 1 >- if i>99: >- tmpname = "" >+ i = i + 1 >+ if i>99: >+ tmpname = "" > > return tmpname >- >+ > def getVGUsedSpace(vgreq, requests, diskset): > vgused = 0 > for request in requests.requests: >- if request.type == REQUEST_LV and request.volumeGroup == vgreq.uniqueID: >- size = int(request.getActualSize(requests, diskset)) >- vgused = vgused + size >+ if request.type == REQUEST_LV and request.volumeGroup == vgreq.uniqueID: >+ size = int(request.getActualSize(requests, diskset)) >+ vgused = vgused + size > > > return vgused >diff --git a/network.py b/network.py >index 7e43aad..8e5ee23 100644 >--- a/network.py >+++ b/network.py >@@ -49,23 +49,23 @@ class IPMissing(Exception): > > def sanityCheckHostname(hostname): > if len(hostname) < 1: >- return None >+ return None > > # XXX: POSIX says this limit is 255, but Linux also defines HOST_NAME_MAX > # as 64, so I don't know which we should believe. --dcantrell > if len(hostname) > 64: >- return _("Hostname must be 64 or fewer characters in length.") >+ return _("Hostname must be 64 or fewer characters in length.") > > validStart = string.ascii_letters + string.digits > validAll = validStart + ".-" > > if string.find(validStart, hostname[0]) == -1: >- return _("Hostname must start with a valid character in the ranges " >- "'a-z', 'A-Z', or '0-9'") >+ return _("Hostname must start with a valid character in the ranges " >+ "'a-z', 'A-Z', or '0-9'") > > for i in range(1, len(hostname)): >- if string.find(validAll, hostname[i]) == -1: >- return _("Hostnames can only contain the characters 'a-z', 'A-Z', '0-9', '-', or '.'") >+ if string.find(validAll, hostname[i]) == -1: >+ return _("Hostnames can only contain the characters 'a-z', 'A-Z', '0-9', '-', or '.'") > > return None > >@@ -191,14 +191,14 @@ class NetworkDevice(SimpleConfigFile): > > def __init__(self, dev): > self.info = { "DEVICE" : dev } >- if dev.startswith('ctc'): >- self.info["TYPE"] = "CTC" >- elif dev.startswith('iucv'): >- self.info["TYPE"] = "IUCV" >+ if dev.startswith('ctc'): >+ self.info["TYPE"] = "CTC" >+ elif dev.startswith('iucv'): >+ self.info["TYPE"] = "IUCV" > > class Network: > def __init__(self): >- self.firstnetdevice = None >+ self.firstnetdevice = None > self.netdevices = {} > self.gateway = "" > self.primaryNS = "" >@@ -307,45 +307,45 @@ class Network: > self.netdevices[dev].set(('useIPv6', False)) > > # XXX: this code needs to be improved too >- try: >- f = open("/etc/resolv.conf", "r") >- except: >- pass >- else: >- lines = f.readlines() >- f.close() >- for line in lines: >- resolv = string.split(line) >- if resolv and resolv[0] == 'nameserver': >- if self.primaryNS == "": >- self.primaryNS = resolv[1] >- elif self.secondaryNS == "": >- self.secondaryNS = resolv[1] >- >- # now initialize remaining devices >- # XXX we just throw return away, the method initialize a >- # object member so we dont need to >- available_devices = self.available() >- >- if len(available_devices) > 0: >- # set first device to start up onboot >- oneactive = 0 >- for dev in available_devices.keys(): >- try: >- if available_devices[dev].get("onboot") == "yes": >- oneactive = 1 >- break >- except: >- continue >- >- if not oneactive: >- self.netdevices[self.firstnetdevice].set(("onboot", "yes")) >+ try: >+ f = open("/etc/resolv.conf", "r") >+ except: >+ pass >+ else: >+ lines = f.readlines() >+ f.close() >+ for line in lines: >+ resolv = string.split(line) >+ if resolv and resolv[0] == 'nameserver': >+ if self.primaryNS == "": >+ self.primaryNS = resolv[1] >+ elif self.secondaryNS == "": >+ self.secondaryNS = resolv[1] >+ >+ # now initialize remaining devices >+ # XXX we just throw return away, the method initialize a >+ # object member so we dont need to >+ available_devices = self.available() >+ >+ if len(available_devices) > 0: >+ # set first device to start up onboot >+ oneactive = 0 >+ for dev in available_devices.keys(): >+ try: >+ if available_devices[dev].get("onboot") == "yes": >+ oneactive = 1 >+ break >+ except: >+ continue >+ >+ if not oneactive: >+ self.netdevices[self.firstnetdevice].set(("onboot", "yes")) > > def getDevice(self, device): >- return self.netdevices[device] >+ return self.netdevices[device] > > def getFirstDeviceName(self): >- return self.firstnetdevice >+ return self.firstnetdevice > > def available(self): > # XXX: this should use NetworkManager >@@ -370,7 +370,7 @@ class Network: > return self.netdevices > > def setHostname(self, hn): >- self.hostname = hn >+ self.hostname = hn > > def setDNS(self, ns): > dns = ns.split(',') >@@ -383,17 +383,17 @@ class Network: > self.gateway = gw > > def lookupHostname(self): >- # can't look things up if they don't exist! >- if not self.hostname or self.hostname == "localhost.localdomain": >+ # can't look things up if they don't exist! >+ if not self.hostname or self.hostname == "localhost.localdomain": > return None >- if not self.primaryNS: >+ if not self.primaryNS: > return > myns = self.primaryNS >- if not hasActiveNetDev(): >- for dev in self.netdevices.values(): >+ if not hasActiveNetDev(): >+ for dev in self.netdevices.values(): > if (dev.get('bootproto').lower() == "dhcp" and > dev.get('onboot') == "yes"): >- ret = isys.dhcpNetDevice(dev) >+ ret = isys.dhcpNetDevice(dev) > if ret is None: > continue > myns = ret >@@ -414,23 +414,23 @@ class Network: > isys.resetResolv() > isys.setResolvRetry(1) > >- if not hasActiveNetDev(): >+ if not hasActiveNetDev(): > log.warning("no network devices were available to look up host name") > return None > >- try: >+ try: > (family, socktype, proto, canonname, sockaddr) = \ > socket.getaddrinfo(self.hostname, None, socket.AF_INET)[0] > (ip, port) = sockaddr >- except: >+ except: > try: > (family, socktype, proto, canonname, sockaddr) = \ > socket.getaddrinfo(self.hostname, None, socket.AF_INET6)[0] > (ip, port, flowinfo, scopeid) = sockaddr > except: >- return None >+ return None > >- return ip >+ return ip > > def nameservers(self): > return (self.primaryNS, self.secondaryNS) >@@ -445,8 +445,8 @@ class Network: > return str > > def writeKS(self, f): >- devNames = self.netdevices.keys() >- devNames.sort() >+ devNames = self.netdevices.keys() >+ devNames.sort() > > if len(devNames) == 0: > return >@@ -460,30 +460,30 @@ class Network: > if dev.get('MTU') and dev.get('MTU') != 0: > f.write(" --mtu=%s" % dev.get('MTU')) > >- onboot = dev.get("onboot") >- if onboot and onboot == "no": >- f.write(" --onboot no") >+ onboot = dev.get("onboot") >+ if onboot and onboot == "no": >+ f.write(" --onboot no") > if dev.get('bootproto').lower() == 'dhcp': > f.write(" --bootproto dhcp") > if dev.get('dhcpclass'): >- f.write(" --class %s" % dev.get('dhcpclass')) >- if self.overrideDHCPhostname: >- if (self.hostname and >- self.hostname != "localhost.localdomain"): >- f.write(" --hostname %s" % self.hostname) >+ f.write(" --class %s" % dev.get('dhcpclass')) >+ if self.overrideDHCPhostname: >+ if (self.hostname and >+ self.hostname != "localhost.localdomain"): >+ f.write(" --hostname %s" % self.hostname) > else: > f.write(" --bootproto static --ip %s --netmask %s" % > (dev.get('ipaddr'), dev.get('netmask'))) > >- if self.gateway is not None: >- f.write(" --gateway %s" % (self.gateway,)) >+ if self.gateway is not None: >+ f.write(" --gateway %s" % (self.gateway,)) > >- if self.dnsString(): >+ if self.dnsString(): > f.write(" --nameserver %s" % (self.dnsString(),)) > >- if (self.hostname and >- self.hostname != "localhost.localdomain"): >- f.write(" --hostname %s" % self.hostname) >+ if (self.hostname and >+ self.hostname != "localhost.localdomain"): >+ f.write(" --hostname %s" % self.hostname) > > f.write("\n"); > >diff --git a/packages.py b/packages.py >index 82fb7c7..5e4530f 100644 >--- a/packages.py >+++ b/packages.py >@@ -69,9 +69,9 @@ def writeRegKey(anaconda): > def writeKSConfiguration(anaconda): > log.info("Writing autokickstart file") > if not flags.test: >- fn = anaconda.rootPath + "/root/anaconda-ks.cfg" >+ fn = anaconda.rootPath + "/root/anaconda-ks.cfg" > else: >- fn = "/tmp/anaconda-ks.cfg" >+ fn = "/tmp/anaconda-ks.cfg" > > anaconda.id.writeKS(fn) > >@@ -119,11 +119,11 @@ def turnOnFilesystems(anaconda): > > if anaconda.dir == DISPATCH_BACK: > log.info("unmounting filesystems") >- anaconda.id.fsset.umountFilesystems(anaconda.rootPath) >- return >+ anaconda.id.fsset.umountFilesystems(anaconda.rootPath) >+ return > > if flags.setupFilesystems: >- if not anaconda.id.upgrade: >+ if not anaconda.id.upgrade: > if not anaconda.id.fsset.isActive(): > # turn off any swaps that we didn't turn on > # needed for live installs >@@ -167,7 +167,7 @@ def turnOnFilesystems(anaconda): > anaconda.intf.messageWindow(_("LVM operation failed"), > str(e)+"\n\n"+_("The installer will now exit..."), > type="custom", custom_icon="error", custom_buttons=[_("_Reboot")]) >- sys.exit(0) >+ sys.exit(0) > > anaconda.id.fsset.formatSwap(anaconda.rootPath) > anaconda.id.fsset.turnOnSwap(anaconda.rootPath) >@@ -183,7 +183,7 @@ def setupTimezone(anaconda): > > # dont do this in test mode! > if flags.test or flags.rootpath: >- return >+ return > > os.environ["TZ"] = anaconda.id.timezone.tz > tzfile = "/usr/share/zoneinfo/" + anaconda.id.timezone.tz >@@ -371,7 +371,7 @@ def betaNagScreen(anaconda): > > > if anaconda.dir == DISPATCH_BACK: >- return DISPATCH_NOOP >+ return DISPATCH_NOOP > > fileagainst = None > for (key, val) in publicBetas.items(): >@@ -381,34 +381,34 @@ def betaNagScreen(anaconda): > fileagainst = "%s Beta" %(productName,) > > while 1: >- rc = anaconda.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") >+ rc = anaconda.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") > %(productName, bugzillaUrl, fileagainst), >- type="custom", custom_icon="warning", >- custom_buttons=[_("_Exit"), _("_Install anyway")]) >+ type="custom", custom_icon="warning", >+ custom_buttons=[_("_Exit"), _("_Install anyway")]) > >- if not rc: >+ if not rc: > if flags.rootpath: > msg = _("The installer will now exit...") > buttons = [_("_Back"), _("_Exit")] > else: > msg = _("Your system will now be rebooted...") > buttons = [_("_Back"), _("_Reboot")] >- rc = anaconda.intf.messageWindow( _("Warning! This is pre-release software!"), >+ rc = anaconda.intf.messageWindow( _("Warning! This is pre-release software!"), > msg, > type="custom", custom_icon="warning", > custom_buttons=buttons) >- if rc: >- sys.exit(0) >- else: >- break >+ if rc: >+ sys.exit(0) >+ else: >+ break >diff --git a/partIntfHelpers.py b/partIntfHelpers.py >index d57b208..a608fc5 100644 >--- a/partIntfHelpers.py >+++ b/partIntfHelpers.py >@@ -40,21 +40,21 @@ def sanityCheckVolumeGroupName(volname): > badNames = ['lvm', 'root', '.', '..' ] > > if not volname: >- return _("Please enter a volume group name.") >+ return _("Please enter a volume group name.") > > # ripped the value for this out of linux/include/lvm.h > if len(volname) > 128: > return _("Volume Group Names must be less than 128 characters") > > if volname in badNames: >- return _("Error - the volume group name %s is not valid." % (volname,)) >+ return _("Error - the volume group name %s is not valid." % (volname,)) > > for i in range(0, len(volname)): >- rc = string.find(string.letters + string.digits + '.' + '_', volname[i]) >- if rc == -1: >- return _("Error - the volume group name contains illegal " >- "characters or spaces. Acceptable characters " >- "are letters, digits, '.' or '_'.") >+ rc = string.find(string.letters + string.digits + '.' + '_', volname[i]) >+ if rc == -1: >+ return _("Error - the volume group name contains illegal " >+ "characters or spaces. Acceptable characters " >+ "are letters, digits, '.' or '_'.") > return None > > def sanityCheckLogicalVolumeName(logvolname): >@@ -62,7 +62,7 @@ def sanityCheckLogicalVolumeName(logvolname): > badNames = ['group', '.', '..' ] > > if not logvolname: >- return _("Please enter a logical volume name.") >+ return _("Please enter a logical volume name.") > > # ripped the value for this out of linux/include/lvm.h > if len(logvolname) > 128: >@@ -70,15 +70,15 @@ def sanityCheckLogicalVolumeName(logvolname): > > > if logvolname in badNames: >- return _("Error - the logical volume name %s is not " >+ return _("Error - the logical volume name %s is not " > "valid." % (logvolname,)) > > for i in range(0, len(logvolname)): >- rc = string.find(string.letters + string.digits + '.' + '_', logvolname[i]) >- if rc == -1: >- return _("Error - the logical volume name contains illegal " >- "characters or spaces. Acceptable characters " >- "are letters, digits, '.' or '_'.") >+ rc = string.find(string.letters + string.digits + '.' + '_', logvolname[i]) >+ if rc == -1: >+ return _("Error - the logical volume name contains illegal " >+ "characters or spaces. Acceptable characters " >+ "are letters, digits, '.' or '_'.") > return None > > def sanityCheckMountPoint(mntpt, fstype, preexisting, format): >@@ -96,8 +96,8 @@ def sanityCheckMountPoint(mntpt, fstype, preexisting, format): > else: > if mntpt[0] != '/' or (len(mntpt) > 1 and mntpt[-1:] == '/'): > passed = 0 >- elif mntpt.find(' ') > -1: >- passed = 0 >+ elif mntpt.find(' ') > -1: >+ passed = 0 > > if not passed: > return _("The mount point %s is invalid. Mount points must start " >@@ -115,20 +115,20 @@ def sanityCheckMountPoint(mntpt, fstype, preexisting, format): > def isNotChangable(request, requestlist): > if request: > if requestlist.isRaidMember(request): >- parentreq = requestlist.getRaidMemberParent(request) >- if parentreq.raidminor is not None: >- return _("This partition is part of " >- "the RAID device /dev/md%s.") % (parentreq.raidminor,) >- else: >- return _("This partition is part of a RAID device.") >- >- if requestlist.isLVMVolumeGroupMember(request): >- parentreq = requestlist.getLVMVolumeGroupMemberParent(request) >- if parentreq.volumeGroupName is not None: >- return _("This partition is part of the " >- "LVM volume group '%s'.") % (parentreq.volumeGroupName,) >- else: >- return _("This partition is part of a LVM volume group.") >+ parentreq = requestlist.getRaidMemberParent(request) >+ if parentreq.raidminor is not None: >+ return _("This partition is part of " >+ "the RAID device /dev/md%s.") % (parentreq.raidminor,) >+ else: >+ return _("This partition is part of a RAID device.") >+ >+ if requestlist.isLVMVolumeGroupMember(request): >+ parentreq = requestlist.getLVMVolumeGroupMemberParent(request) >+ if parentreq.volumeGroupName is not None: >+ return _("This partition is part of the " >+ "LVM volume group '%s'.") % (parentreq.volumeGroupName,) >+ else: >+ return _("This partition is part of a LVM volume group.") > > return None > >@@ -145,7 +145,7 @@ def doDeletePartitionByRequest(intf, requestlist, partition, > if partition == None: > intf.messageWindow(_("Unable To Delete"), > _("You must first select a partition to delete."), >- custom_icon="error") >+ custom_icon="error") > return 0 > > if type(partition) == type("RAID"): >@@ -153,14 +153,14 @@ def doDeletePartitionByRequest(intf, requestlist, partition, > elif partition.type & parted.PARTITION_FREESPACE: > intf.messageWindow(_("Unable To Delete"), > _("You cannot delete free space."), >- custom_icon="error") >+ custom_icon="error") > return 0 > elif partition.type & parted.PARTITION_PROTECTED: > # LDL formatted DASDs always have one partition, you'd have to reformat the > # DASD in CDL mode to get rid of it > intf.messageWindow(_("Unable To Delete"), > _("You cannot delete a partition of a LDL formatted DASD."), >- custom_icon="error") >+ custom_icon="error") > return 0 > else: > device = partedUtils.get_partition_name(partition) >@@ -172,17 +172,17 @@ def doDeletePartitionByRequest(intf, requestlist, partition, > _("You cannot delete this " > "partition, as it is an extended partition " > "which contains %s") %(ret), >- custom_icon="error") >+ custom_icon="error") > return 0 > > # see if device is in our partition requests, remove > if type(partition) == type("RAID"): >- request = requestlist.getRequestByID(device) >+ request = requestlist.getRequestByID(device) > else: >- request = requestlist.getRequestByDeviceName(device) >- >+ request = requestlist.getRequestByDeviceName(device) >+ > if request: >- state = isNotChangable(request, requestlist) >+ state = isNotChangable(request, requestlist) > > # If the partition is protected, we also can't delete it so specify a > # reason why. >@@ -193,9 +193,9 @@ def doDeletePartitionByRequest(intf, requestlist, partition, > if state: > if not quiet: > intf.messageWindow(_("Unable To Delete"), >- _("You cannot delete this partition:\n\n") + state, >- custom_icon="error") >- return 0 >+ _("You cannot delete this partition:\n\n") + state, >+ custom_icon="error") >+ return 0 > > if confirm and not confirmDeleteRequest(intf, request): > return 0 >@@ -235,17 +235,17 @@ def doDeletePartitionByRequest(intf, requestlist, partition, > return 1 > > def doDeletePartitionsByDevice(intf, requestlist, diskset, device, >- confirm=1, quiet=0): >+ confirm=1, quiet=0): > """ 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")]) >+ 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")]) > >- if not rc: >- return >+ if not rc: >+ return > > requests = requestlist.getRequestsByDevice(diskset, device) > if not requests: >@@ -254,41 +254,41 @@ def doDeletePartitionsByDevice(intf, requestlist, diskset, device, > # get list of unique IDs of these requests > reqIDs = [] > for req in requests: >- part = partedUtils.get_partition_by_name(diskset.disks, req.device) >- if part.type & parted.PARTITION_FREESPACE or part.type & parted.PARTITION_METADATA or part.type & parted.PARTITION_PROTECTED: >- continue >- reqIDs.append(req.uniqueID) >+ part = partedUtils.get_partition_by_name(diskset.disks, req.device) >+ if part.type & parted.PARTITION_FREESPACE or part.type & parted.PARTITION_METADATA or part.type & parted.PARTITION_PROTECTED: >+ continue >+ reqIDs.append(req.uniqueID) > > # now go thru and try to delete the unique IDs > for id in reqIDs: > try: >- req = requestlist.getRequestByID(id) >- if req is None: >- continue >+ req = requestlist.getRequestByID(id) >+ if req is None: >+ continue > part = partedUtils.get_partition_by_name(diskset.disks, req.device) > rc = doDeletePartitionByRequest(intf, requestlist, part, > confirm=0, quiet=1) > if not rc: >- pass >+ pass > except: >- pass >+ pass > > # see which partitions are left > notdeleted = [] > left_requests = requestlist.getRequestsByDevice(diskset, device) > if left_requests: >- # get list of unique IDs of these requests >- leftIDs = [] >- for req in left_requests: >- part = partedUtils.get_partition_by_name(diskset.disks, req.device) >- if part.type & parted.PARTITION_FREESPACE or part.type & parted.PARTITION_METADATA or part.type & parted.PARTITION_PROTECTED: >- continue >- leftIDs.append(req.uniqueID) >- >- for id in leftIDs: >- req = requestlist.getRequestByID(id) >- notdeleted.append(req) >- >+ # get list of unique IDs of these requests >+ leftIDs = [] >+ for req in left_requests: >+ part = partedUtils.get_partition_by_name(diskset.disks, req.device) >+ if part.type & parted.PARTITION_FREESPACE or part.type & parted.PARTITION_METADATA or part.type & parted.PARTITION_PROTECTED: >+ continue >+ leftIDs.append(req.uniqueID) >+ >+ for id in leftIDs: >+ req = requestlist.getRequestByID(id) >+ notdeleted.append(req) >+ > > # see if we need to report any failures - some were because we removed > # an extended partition which contained other members of our delete list >@@ -302,7 +302,7 @@ def doDeletePartitionsByDevice(intf, requestlist, diskset, device, > intf.messageWindow(_("Notice"), > _("The following partitions were not deleted " > "because they are in use:\n\n%s") % outlist, >- custom_icon="warning") >+ custom_icon="warning") > > return 1 > >@@ -323,24 +323,24 @@ def doEditPartitionByRequest(intf, requestlist, part): > > if type(part) == type("RAID"): > >- # see if device is in our partition requests, remove >+ # see if device is in our partition requests, remove > request = requestlist.getRequestByID(int(part)) >- >- if request: >- 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") >- return (None, None) >- >- if request.type == REQUEST_RAID: >- return ("RAID", request) >- elif request.type == REQUEST_VG: >- return ("LVMVG", request) >- elif request.type == REQUEST_LV: >- return ("LVMLV", request) >- else: >- return (None, None) >+ >+ if request: >+ 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") >+ return (None, None) >+ >+ if request.type == REQUEST_RAID: >+ return ("RAID", request) >+ elif request.type == REQUEST_VG: >+ return ("LVMVG", request) >+ elif request.type == REQUEST_LV: >+ return ("LVMLV", request) >+ else: >+ return (None, None) > elif part.type & parted.PARTITION_FREESPACE: > request = partRequests.PartitionSpec(fsset.fileSystemTypeGetDefault(), > start = partedUtils.start_sector_to_cyl(part.geom.dev, >@@ -364,12 +364,12 @@ def doEditPartitionByRequest(intf, requestlist, part): > name = partedUtils.get_partition_name(part) > request = requestlist.getRequestByDeviceName(name) > if request: >- 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") >- return (None, None) >- >+ 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") >+ return (None, None) >+ > return ("PARTITION", request) > else: # shouldn't ever happen > raise ValueError, ("Trying to edit non-existent partition %s" >@@ -396,7 +396,7 @@ def checkForSwapNoMatch(anaconda): > "Would you like to format this " > "partition as a swap partition?") > % (request.device), type = "yesno", >- custom_icon="question") >+ custom_icon="question") > if rc == 1: > request.format = 1 > request.fstype = fsset.fileSystemTypeGet("swap") >@@ -437,7 +437,7 @@ def partitionSanityErrors(intf, errors): > "These errors must be corrected prior " > "to continuing with your install of " > "%s.\n\n%s") %(productName, errorstr), >- custom_icon="error") >+ custom_icon="error") > return rc > > def partitionSanityWarnings(intf, warnings): >@@ -514,27 +514,27 @@ def getPreExistFormatWarnings(partitions, diskset): > def confirmDeleteRequest(intf, request): > """Confirm the deletion of a request.""" > if not request: >- return >+ return > > if request.type == REQUEST_VG: >- errmsg = (_("You are about to delete the volume group \"%s\"." >+ errmsg = (_("You are about to delete the volume group \"%s\"." > "\n\nALL logical volumes in this volume group " > "will be lost!") % (request.volumeGroupName,)) > elif request.type == REQUEST_LV: >- errmsg = (_("You are about to delete the logical volume \"%s\".") >+ errmsg = (_("You are about to delete the logical volume \"%s\".") > % (request.logicalVolumeName,)) > elif request.type == REQUEST_RAID: >- errmsg = _("You are about to delete a RAID device.") >+ errmsg = _("You are about to delete a RAID device.") > else: >- if request.device: >- errmsg = _("You are about to delete the /dev/%s partition.") % (request.device,) >- else: >- # XXX can this ever happen? >- errmsg = _("The partition you selected will be deleted.") >+ if request.device: >+ errmsg = _("You are about to delete the /dev/%s partition.") % (request.device,) >+ else: >+ # XXX can this ever happen? >+ errmsg = _("The partition you selected will be deleted.") > > rc = intf.messageWindow(_("Confirm Delete"), errmsg, type="custom", >- custom_buttons=[_("Cancel"), _("_Delete")], >- custom_icon="question") >+ custom_buttons=[_("Cancel"), _("_Delete")], >+ custom_icon="question") > > return rc > >diff --git a/partRequests.py b/partRequests.py >index b43f503..b69e2b9 100644 >--- a/partRequests.py >+++ b/partRequests.py >@@ -262,8 +262,8 @@ class RequestSpec: > mustbeonlinuxfs = ('/', '/boot', '/var', '/tmp', '/usr', '/home', > '/usr/share', '/usr/lib' ) > >- # these are symlinks so you cant make them mount points >- otherexcept = ('/var/mail', '/usr/bin/X11', '/usr/lib/X11', '/usr/tmp') >+ # these are symlinks so you cant make them mount points >+ otherexcept = ('/var/mail', '/usr/bin/X11', '/usr/lib/X11', '/usr/tmp') > > if not self.mountpoint: > return None >@@ -283,11 +283,11 @@ class RequestSpec: > if self.mountpoint in mustbeonroot: > return _("This mount point is invalid. The %s directory must " > "be on the / file system.") % (self.mountpoint,) >- elif self.mountpoint in otherexcept: >+ 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,) > > return None > >@@ -308,8 +308,8 @@ class RequestSpec: > > if partitions and partitions.requests: > for request in partitions.requests: >- if requestSkipList is not None and request.uniqueID in requestSkipList: >- continue >+ if requestSkipList is not None and request.uniqueID in requestSkipList: >+ continue > > if request.mountpoint == mntpt: > if (not self.uniqueID or >@@ -353,10 +353,10 @@ class RequestSpec: > if rc: > return rc > >- if not skipMntPtExistCheck: >- rc = self.isMountPointInUse(partitions) >- if rc: >- return rc >+ if not skipMntPtExistCheck: >+ rc = self.isMountPointInUse(partitions) >+ if rc: >+ return rc > > rc = self.doMountPointLinuxFSChecks() > if rc: >@@ -902,7 +902,7 @@ class LogicalVolumeRequestSpec(RequestSpec): > def __init__(self, fstype, format = None, mountpoint = None, > size = None, volgroup = None, lvname = None, > preexist = 0, percent = None, grow=0, maxSizeMB=0, >- fslabel = None, fsprofile = None): >+ fslabel = None, fsprofile = None): > """Create a new VolumeGroupRequestSpec object. > > fstype is the fsset filesystem type. >@@ -913,8 +913,8 @@ class LogicalVolumeRequestSpec(RequestSpec): > lvname is the name of the logical volume. > preexist is whether the logical volume previously existed or not. > percent is the percentage of the volume group's space this should use. >- grow is whether or not to use free space remaining. >- maxSizeMB is max size to grow to. >+ grow is whether or not to use free space remaining. >+ maxSizeMB is max size to grow to. > fslabel is the label of the filesystem on the logical volume. > fsprofile is the usage profile for the filesystem. > """ >@@ -925,11 +925,11 @@ class LogicalVolumeRequestSpec(RequestSpec): > else: > origfs = None > >- RequestSpec.__init__(self, fstype = fstype, format = format, >- mountpoint = mountpoint, size = size, >- preexist = preexist, origfstype = origfs, >- fslabel = fslabel, fsprofile = fsprofile) >- >+ RequestSpec.__init__(self, fstype = fstype, format = format, >+ mountpoint = mountpoint, size = size, >+ preexist = preexist, origfstype = origfs, >+ fslabel = fslabel, fsprofile = fsprofile) >+ > self.type = REQUEST_LV > > self.logicalVolumeName = lvname >@@ -941,11 +941,11 @@ class LogicalVolumeRequestSpec(RequestSpec): > > self.minResizeSize = None > self.resizable = True >- >+ > if not percent and not size and not preexist: > raise RuntimeError, "Error with Volume Group:Logical Volume %s:%s - Logical Volume must specify either percentage of vgsize or size" % (volgroup, lvname) > >- if percent and grow: >+ if percent and grow: > raise RuntimeError, "Error with Volume Group:Logical Volume %s:%s - Logical Volume cannot grow if percentage given" % (volgroup, lvname) > > def __str__(self): >@@ -972,7 +972,7 @@ class LogicalVolumeRequestSpec(RequestSpec): > {"mount": self.mountpoint, "id": self.uniqueID, > "fstype": fsname, "format": self.format, > "lvname": self.logicalVolumeName, "vgid": self.volumeGroup, >- "size": size, "crypto": crypto, >+ "size": size, "crypto": crypto, > "fsopts": self.fsopts, "fsprofile": self.fsprofile}) > return str > >@@ -1003,9 +1003,9 @@ class LogicalVolumeRequestSpec(RequestSpec): > if partitions is None or diskset is None: > raise RuntimeError, "trying to get a percentage lv size on resize path" > vgreq = partitions.getRequestByID(self.volumeGroup) >- vgsize = vgreq.getActualSize(partitions, diskset) >- lvsize = int(self.percent * 0.01 * vgsize) >- #lvsize = lvm.clampLVSizeRequest(lvsize, vgreq.pesize) >+ vgsize = vgreq.getActualSize(partitions, diskset) >+ lvsize = int(self.percent * 0.01 * vgsize) >+ #lvsize = lvm.clampLVSizeRequest(lvsize, vgreq.pesize) > return lvsize > # FIXME: the target bit here is a bit of a hack... > elif self.targetSize is not None and target: >@@ -1015,17 +1015,17 @@ class LogicalVolumeRequestSpec(RequestSpec): > > def getStartSize(self): > """Return the starting size allocated for the request in megabytes.""" >- return self.startSize >+ return self.startSize > > def setSize(self, size): >- """Set the size (in MB) of request (does not clamp to PE however) >+ """Set the size (in MB) of request (does not clamp to PE however) > >- size - size in MB >- """ >- if self.percent: >- self.percent = None >+ size - size in MB >+ """ >+ if self.percent: >+ self.percent = None > >- self.size = size >+ self.size = size > > def sanityCheckRequest(self, partitions, skipMntPtExistCheck=0, pesize=32768): > """Run the basic sanity checks on the request.""" >diff --git a/partedUtils.py b/partedUtils.py >index 86c1e45..cc5c8a5 100644 >--- a/partedUtils.py >+++ b/partedUtils.py >@@ -498,7 +498,7 @@ def getReleaseString(mountpoint): > # return the first line with the newline at the end stripped > if len(lines) == 0: > return "" >- relstr = string.strip(lines[0][:-1]) >+ relstr = string.strip(lines[0][:-1]) > > # get the release name and version > # assumes that form is something >@@ -806,8 +806,8 @@ class DiskSet: > isys.umount(self.anaconda.rootPath) > > # now, look for candidate lvm roots >- lvm.vgscan() >- lvm.vgactivate() >+ lvm.vgscan() >+ lvm.vgactivate() > > for dev, crypto in self.anaconda.id.partitions.encryptedDevices.items(): > # FIXME: order these so LVM and RAID always work on the first try >@@ -850,7 +850,7 @@ class DiskSet: > rootparts.append ((theDev, fs, relstr, label)) > isys.umount(self.anaconda.rootPath) > >- lvm.vgdeactivate() >+ lvm.vgdeactivate() > > # don't stop raid until after we've looked for lvm on top of it > self.stopMdRaid() >@@ -922,13 +922,13 @@ class DiskSet: > > def driveList (self): > """Return the list of drives on the system.""" >- drives = isys.hardDriveDict().keys() >- drives.sort (isys.compareDrives) >- return drives >+ drives = isys.hardDriveDict().keys() >+ drives.sort (isys.compareDrives) >+ return drives > > def drivesByName (self): > """Return a dictionary of the drives on the system.""" >- return isys.hardDriveDict() >+ return isys.hardDriveDict() > > def savePartitions (self): > """Write the partition tables out to the disks.""" >@@ -1045,7 +1045,7 @@ class DiskSet: > os.execv(argList[0], argList) > log.critical("failed to exec %s", argList) > os._exit(1) >- >+ > os.close(p[1]) > > num = '' >diff --git a/partitions.py b/partitions.py >index 5fabdb3..a9e5d4a 100644 >--- a/partitions.py >+++ b/partitions.py >@@ -610,23 +610,23 @@ class Partitions: > for request in self.requests: > if request.mountpoint == mount: > return request >- >- for request in self.requests: >- if request.type == REQUEST_LV and request.mountpoint == mount: >- return request >+ >+ for request in self.requests: >+ if request.type == REQUEST_LV and request.mountpoint == mount: >+ return request > return None > > def getRequestByDeviceName(self, device): > """Find and return the request with the given device name.""" >- if device is None: >- return None >- >+ if device is None: >+ return None >+ > for request in self.requests: >- if request.type == REQUEST_RAID and request.raidminor is not None: >- tmp = "md%d" % (request.raidminor,) >- if tmp == device: >- return request >- elif request.device == device: >+ if request.type == REQUEST_RAID and request.raidminor is not None: >+ tmp = "md%d" % (request.raidminor,) >+ if tmp == device: >+ return request >+ elif request.device == device: > return request > elif request.encryption: > deviceUUID = cryptodev.luksUUID("/dev/" + device) >@@ -665,23 +665,23 @@ class Partitions: > > def getRequestByVolumeGroupName(self, volname): > """Find and return the request with the given volume group name.""" >- if volname is None: >- return None >- >- for request in self.requests: >- if (request.type == REQUEST_VG and >+ if volname is None: >+ return None >+ >+ for request in self.requests: >+ if (request.type == REQUEST_VG and > request.volumeGroupName == volname): >- return request >+ return request > return None > > def getRequestByLogicalVolumeName(self, lvname): > """Find and return the request with the given logical volume name.""" >- if lvname is None: >- return None >- for request in self.requests: >- if (request.type == REQUEST_LV and >+ if lvname is None: >+ return None >+ for request in self.requests: >+ if (request.type == REQUEST_LV and > request.logicalVolumeName == lvname): >- return request >+ return request > return None > > def getRequestByID(self, id): >@@ -689,8 +689,8 @@ class Partitions: > > Note that if id is a string, it will be converted to an int for you. > """ >- if type(id) == type("a string"): >- id = int(id) >+ if type(id) == type("a string"): >+ id = int(id) > for request in self.requests: > if request.uniqueID == id: > return request >@@ -722,7 +722,7 @@ class Partitions: > raidMinors.remove(request.raidminor) > > return raidMinors >- >+ > > def getAvailRaidPartitions(self, request, diskset): > """Return a list of tuples of RAID partitions which can be used. >@@ -757,7 +757,7 @@ class Partitions: > rc.append((partname, size, 0)) > elif used == 2: > rc.append((partname, size, 1)) >- >+ > return rc > > def getRaidMemberParent(self, request): >@@ -775,17 +775,17 @@ class Partitions: > > def isRaidMember(self, request): > """Return whether or not the request is being used in a RAID device.""" >- if self.getRaidMemberParent(request) is not None: >- return 1 >- else: >- return 0 >+ if self.getRaidMemberParent(request) is not None: >+ return 1 >+ else: >+ return 0 > > def getLVMLVForVGID(self, vgid): > """Find and return a list of all the LVs associated with a VG id.""" > retval = [] > for request in self.requests: >- if request.type == REQUEST_LV: >- if request.volumeGroup == vgid: >+ if request.type == REQUEST_LV: >+ if request.volumeGroup == vgid: > retval.append(request) > return retval > >@@ -793,7 +793,7 @@ class Partitions: > """Find and return a list of all of the LVs in the VG.""" > vgid = vgrequest.uniqueID > return self.getLVMLVForVGID(vgid) >- >+ > def getLVMRequests(self): > """Return a dictionary of all of the LVM bits. > >@@ -803,7 +803,7 @@ class Partitions: > for request in self.requests: > if request.type == REQUEST_VG: > retval[request.volumeGroupName] = self.getLVMLVForVG(request) >- >+ > return retval > > def getPartialLVMRequests(self): >@@ -812,7 +812,7 @@ class Partitions: > for request in self.deletes: > if isinstance(request, partRequests.PartialVolumeGroupSpec): > retval.append(request.volumeGroupName) >- >+ > return retval > > def getLVMVGRequests(self): >@@ -876,18 +876,18 @@ class Partitions: > elif used == 2: > rc.append((partrequest.uniqueID, size, 1)) > >- # now find available RAID devices >- raiddev = self.getRaidRequests() >- if raiddev: >- raidcounter = 0 >- for dev in raiddev: >+ # now find available RAID devices >+ raiddev = self.getRaidRequests() >+ if raiddev: >+ raidcounter = 0 >+ for dev in raiddev: > used = 0 > >- if dev.fstype is None: >- continue >- if dev.fstype.getName() != "physical volume (LVM)": >- continue >- >+ if dev.fstype is None: >+ continue >+ if dev.fstype.getName() != "physical volume (LVM)": >+ continue >+ > for volgroup in volgroups: > if volgroup.physicalVolumes: > if dev.uniqueID in volgroup.physicalVolumes: >@@ -899,7 +899,7 @@ class Partitions: > > if used: > break >- >+ > size = dev.getActualSize(self, diskset) > > if used == 0: >@@ -907,28 +907,28 @@ class Partitions: > elif used == 2: > rc.append((dev.uniqueID, size, 1)) > >- raidcounter = raidcounter + 1 >+ raidcounter = raidcounter + 1 > return rc > > def getLVMVolumeGroupMemberParent(self, request): > """Return parent volume group of a physical volume""" >- volgroups = self.getLVMVGRequests() >- if not volgroups: >- return None >+ volgroups = self.getLVMVGRequests() >+ if not volgroups: >+ return None > >- for volgroup in volgroups: >- if volgroup.physicalVolumes: >- if request.uniqueID in volgroup.physicalVolumes: >- return volgroup >+ for volgroup in volgroups: >+ if volgroup.physicalVolumes: >+ if request.uniqueID in volgroup.physicalVolumes: >+ return volgroup > >- return None >+ return None > > def isLVMVolumeGroupMember(self, request): > """Return whether or not the request is being used in an LVM device.""" >- if self.getLVMVolumeGroupMemberParent(request) is None: >- return 0 >- else: >- return 1 >+ if self.getLVMVolumeGroupMemberParent(request) is None: >+ return 0 >+ else: >+ return 1 > > def isVolumeGroupNameInUse(self, vgname): > """Return whether or not the requested volume group name is in use.""" >@@ -1055,17 +1055,17 @@ class Partitions: > """Resort the requests into allocation order.""" > n = 0 > while n < len(self.requests): >- # Ignore LVM Volume Group and Logical Volume requests, >- # since these are not related to allocating disk partitions >- if (self.requests[n].type == REQUEST_VG or self.requests[n].type == REQUEST_LV): >- n = n + 1 >- continue >- >+ # Ignore LVM Volume Group and Logical Volume requests, >+ # since these are not related to allocating disk partitions >+ if (self.requests[n].type == REQUEST_VG or self.requests[n].type == REQUEST_LV): >+ n = n + 1 >+ continue >+ > for request in self.requests: >- # Ignore LVM Volume Group and Logical Volume requests, >- # since these are not related to allocating disk partitions >- if (request.type == REQUEST_VG or request.type == REQUEST_LV): >- continue >+ # Ignore LVM Volume Group and Logical Volume requests, >+ # since these are not related to allocating disk partitions >+ if (request.type == REQUEST_VG or request.type == REQUEST_LV): >+ continue > # for raid requests, the only thing that matters for sorting > # is the raid device since ordering by size is mostly > # irrelevant. this also keeps things more consistent >@@ -1601,23 +1601,23 @@ class Partitions: > args.extend(["--name=%s" %(request.logicalVolumeName,), > "--vgname=%s" %(vg.volumeGroupName,)]) > >- if request.grow: >- if request.startSize: >- args.append("--size=%s" % (int(request.startSize),)) >- else: >- # shouldnt happen >- continue >- >- args.append("--grow") >- if request.maxSizeMB and int(request.maxSizeMB) > 0: >- args.append("--maxsize=%s" % (request.maxSizeMB,)) >- else: >- if request.percent: >- args.append("--percent=%s" %(request.percent,)) >- elif request.size: >- args.append("--size=%s" %(int(request.size),)) >- else: >- continue >+ if request.grow: >+ if request.startSize: >+ args.append("--size=%s" % (int(request.startSize),)) >+ else: >+ # shouldnt happen >+ continue >+ >+ args.append("--grow") >+ if request.maxSizeMB and int(request.maxSizeMB) > 0: >+ args.append("--maxsize=%s" % (request.maxSizeMB,)) >+ else: >+ if request.percent: >+ args.append("--percent=%s" %(request.percent,)) >+ elif request.size: >+ args.append("--size=%s" %(int(request.size),)) >+ else: >+ continue > > f.write("#logvol %s\n" % (string.join(args))) > >diff --git a/raid.py b/raid.py >index 117ca6f..538bced 100644 >--- a/raid.py >+++ b/raid.py >@@ -98,60 +98,60 @@ def scanForRaid(drives): > log.error("reading raid sb failed for %s",dev) > continue > >- if raidSets.has_key(raidSet): >- (knownLevel, knownDisks, knownMinor, knownDevices) = \ >- raidSets[raidSet] >- if knownLevel != level or knownDisks != totalDisks or \ >- knownMinor != mdMinor: >+ if raidSets.has_key(raidSet): >+ (knownLevel, knownDisks, knownMinor, knownDevices) = \ >+ raidSets[raidSet] >+ if knownLevel != level or knownDisks != totalDisks or \ >+ knownMinor != mdMinor: > # Raise hell >- log.error("raid set inconsistency for md%d: " >+ log.error("raid set inconsistency for md%d: " > "all drives in this raid set do not " > "agree on raid parameters. Skipping raid device", > mdMinor) > continue >- knownDevices.append(dev) >- raidSets[raidSet] = (knownLevel, knownDisks, knownMinor, >- knownDevices) >- else: >- raidSets[raidSet] = (level, totalDisks, mdMinor, [dev,]) >- >- if raidDevices.has_key(mdMinor): >- if (raidDevices[mdMinor] != raidSet): >- log.error("raid set inconsistency for md%d: " >+ knownDevices.append(dev) >+ raidSets[raidSet] = (knownLevel, knownDisks, knownMinor, >+ knownDevices) >+ else: >+ raidSets[raidSet] = (level, totalDisks, mdMinor, [dev,]) >+ >+ if raidDevices.has_key(mdMinor): >+ if (raidDevices[mdMinor] != raidSet): >+ log.error("raid set inconsistency for md%d: " > "found members of multiple raid sets " > "that claim to be md%d. Using only the first " > "array found.", mdMinor, mdMinor) > continue >- else: >- raidDevices[mdMinor] = raidSet >+ else: >+ raidDevices[mdMinor] = raidSet > > raidList = [] > for key in raidSets.keys(): >- (level, totalDisks, mdMinor, devices) = raidSets[key] >- if len(devices) < totalDisks: >+ (level, totalDisks, mdMinor, devices) = raidSets[key] >+ if len(devices) < totalDisks: > log.warning("missing components of raid device md%d. The " > "raid device needs %d drive(s) and only %d (was/were) " > "found. This raid device will not be started.", mdMinor, > totalDisks, len(devices)) >- continue >- raidList.append((mdMinor, devices, level, totalDisks)) >+ continue >+ raidList.append((mdMinor, devices, level, totalDisks)) > > return raidList >- >+ > def startAllRaid(driveList): > """Do a raid start on raid devices and return a list like scanForRaid.""" > rc = [] > mdList = scanForRaid(driveList) > for mdDevice, deviceList, level, numActive in mdList: >- devName = "md%d" % (mdDevice,) >- isys.raidstart(devName, deviceList[0]) >+ devName = "md%d" % (mdDevice,) >+ isys.raidstart(devName, deviceList[0]) > rc.append((devName, deviceList, level, numActive)) > return rc > > def stopAllRaid(mdList): > """Do a raid stop on each of the raid device tuples given.""" > for dev, devices, level, numActive in mdList: >- isys.raidstop(dev) >+ isys.raidstop(dev) > > def isRaid10(raidlevel): > """Return whether raidlevel is a valid descriptor of RAID10.""" >diff --git a/rescue.py b/rescue.py >index 028471c..5fc574b 100644 >--- a/rescue.py >+++ b/rescue.py >@@ -50,36 +50,36 @@ class RescueInterface: > > def messageWindow(self, title, text, type = "ok", default = None, > custom_icon=None, custom_buttons=[]): >- if type == "ok": >- ButtonChoiceWindow(self.screen, title, text, >- buttons=[TEXT_OK_BUTTON]) >+ if type == "ok": >+ ButtonChoiceWindow(self.screen, title, text, >+ buttons=[TEXT_OK_BUTTON]) > elif type == "yesno": > if default and default == "no": > btnlist = [TEXT_NO_BUTTON, TEXT_YES_BUTTON] > else: > btnlist = [TEXT_YES_BUTTON, TEXT_NO_BUTTON] >- rc = ButtonChoiceWindow(self.screen, title, text, >- buttons=btnlist) >+ rc = ButtonChoiceWindow(self.screen, title, text, >+ buttons=btnlist) > if rc == "yes": > return 1 > else: > return 0 >- elif type == "custom": >- tmpbut = [] >- for but in custom_buttons: >- tmpbut.append(string.replace(but,"_","")) >- >- rc = ButtonChoiceWindow(self.screen, title, text, width=60, >- buttons=tmpbut) >- >- idx = 0 >- for b in tmpbut: >- if string.lower(b) == rc: >- return idx >- idx = idx + 1 >- return 0 >- else: >- return OkCancelWindow(self.screen, title, text) >+ elif type == "custom": >+ tmpbut = [] >+ for but in custom_buttons: >+ tmpbut.append(string.replace(but,"_","")) >+ >+ rc = ButtonChoiceWindow(self.screen, title, text, width=60, >+ buttons=tmpbut) >+ >+ idx = 0 >+ for b in tmpbut: >+ if string.lower(b) == rc: >+ return idx >+ idx = idx + 1 >+ return 0 >+ else: >+ return OkCancelWindow(self.screen, title, text) > > def passphraseEntryWindow(self, device): > w = PassphraseEntryWindow(self.screen, device) >diff --git a/scripts/makestamp.py b/scripts/makestamp.py >index c3f416c..d9cd606 100755 >--- a/scripts/makestamp.py >+++ b/scripts/makestamp.py >@@ -53,7 +53,7 @@ for (str, arg) in args: > elif str == "--allDiscs": > allDiscs = 1 > else: >- print "unknown str of ", str >+ print "unknown str of ", str > usage() > > if data["timestamp"] is None: >diff --git a/scripts/maketreeinfo.py b/scripts/maketreeinfo.py >index c53a672..6ae0d34 100644 >--- a/scripts/maketreeinfo.py >+++ b/scripts/maketreeinfo.py >@@ -63,7 +63,7 @@ for (str, arg) in args: > elif str == "--allDiscs": > allDiscs = 1 > else: >- print "unknown str of ", str >+ print "unknown str of ", str > usage() > > # Make sure timestamp is actually a float >diff --git a/security.py b/security.py >index c784287..165b295 100644 >--- a/security.py >+++ b/security.py >@@ -52,7 +52,7 @@ class Security: > log.error("unknown selinux state: %s" %(self.selinux,)) > return > >- f.write("selinux --%s\n" %(selinux_states[self.selinux],)) >+ f.write("selinux --%s\n" %(selinux_states[self.selinux],)) > > def write(self, instPath): > args = [ "--quiet", "--nostart" ] >diff --git a/text.py b/text.py >index e98e849..b4c0d4d 100644 >--- a/text.py >+++ b/text.py >@@ -82,40 +82,40 @@ class InstallWindow: > > class WaitWindow: > def pop(self): >- self.screen.popWindow() >- self.screen.refresh() >+ self.screen.popWindow() >+ self.screen.refresh() > > def refresh(self): > pass > > def __init__(self, screen, title, text): >- self.screen = screen >- width = 40 >- if (len(text) < width): width = len(text) >+ self.screen = screen >+ width = 40 >+ if (len(text) < width): width = len(text) > >- t = TextboxReflowed(width, text) >+ t = TextboxReflowed(width, text) > >- g = GridForm(self.screen, title, 1, 1) >- g.add(t, 0, 0) >- g.draw() >- self.screen.refresh() >+ g = GridForm(self.screen, title, 1, 1) >+ g.add(t, 0, 0) >+ g.draw() >+ self.screen.refresh() > > class OkCancelWindow: > def getrc(self): >- return self.rc >+ return self.rc > > def __init__(self, screen, title, text): >- rc = ButtonChoiceWindow(screen, title, text, >- buttons=[TEXT_OK_BUTTON, _("Cancel")]) >- if rc == string.lower(_("Cancel")): >- self.rc = 1 >- else: >- self.rc = 0 >+ rc = ButtonChoiceWindow(screen, title, text, >+ buttons=[TEXT_OK_BUTTON, _("Cancel")]) >+ if rc == string.lower(_("Cancel")): >+ self.rc = 1 >+ else: >+ self.rc = 0 > > class ProgressWindow: > def pop(self): >- self.screen.popWindow() >- self.screen.refresh() >+ self.screen.popWindow() >+ self.screen.refresh() > del self.scale > self.scale = None > >@@ -133,21 +133,21 @@ class ProgressWindow: > self.multiplier = 1 > if total == 1.0: > self.multiplier = 100 >- self.screen = screen >- width = 55 >- if (len(text) > width): width = len(text) >+ self.screen = screen >+ width = 55 >+ if (len(text) > width): width = len(text) > >- t = TextboxReflowed(width, text) >+ t = TextboxReflowed(width, text) > >- g = GridForm(self.screen, title, 1, 2) >- g.add(t, 0, 0, (0, 0, 0, 1), anchorLeft=1) >+ g = GridForm(self.screen, title, 1, 2) >+ g.add(t, 0, 0, (0, 0, 0, 1), anchorLeft=1) > > self.scale = Scale(int(width), int(float(total) * self.multiplier)) > if not pulse: > g.add(self.scale, 0, 1) > >- g.draw() >- self.screen.refresh() >+ g.draw() >+ self.screen.refresh() > > class SaveExceptionWindow: > def __init__(self, anaconda, longTracebackFile=None, screen=None): >@@ -295,7 +295,7 @@ class MainExceptionWindow: > > def run(self): > log.info ("in run, screen = %s" % self.screen) >- self.rc = ButtonChoiceWindow(self.screen, _("Exception Occurred"), >+ self.rc = ButtonChoiceWindow(self.screen, _("Exception Occurred"), > self.text, self.buttons) > > def getrc(self): >@@ -308,7 +308,7 @@ class MainExceptionWindow: > > def pop(self): > self.screen.popWindow() >- self.screen.refresh() >+ self.screen.refresh() > > class LuksPassphraseWindow: > def __init__(self, screen, passphrase = "", device = "", isglobal = False): >@@ -438,37 +438,37 @@ class InstallInterface: > return ProgressWindow(self.screen, title, text, total, updpct, pulse) > > def messageWindow(self, title, text, type="ok", default = None, >- custom_icon=None, custom_buttons=[]): >- if type == "ok": >- ButtonChoiceWindow(self.screen, title, text, >- buttons=[TEXT_OK_BUTTON]) >+ custom_icon=None, custom_buttons=[]): >+ if type == "ok": >+ ButtonChoiceWindow(self.screen, title, text, >+ buttons=[TEXT_OK_BUTTON]) > elif type == "yesno": > if default and default == "no": > btnlist = [TEXT_NO_BUTTON, TEXT_YES_BUTTON] > else: > btnlist = [TEXT_YES_BUTTON, TEXT_NO_BUTTON] >- rc = ButtonChoiceWindow(self.screen, title, text, >- buttons=btnlist) >+ rc = ButtonChoiceWindow(self.screen, title, text, >+ buttons=btnlist) > if rc == "yes": > return 1 > else: > return 0 >- elif type == "custom": >- tmpbut = [] >- for but in custom_buttons: >- tmpbut.append(string.replace(but,"_","")) >- >- rc = ButtonChoiceWindow(self.screen, title, text, width=60, >- buttons=tmpbut) >- >- idx = 0 >- for b in tmpbut: >- if string.lower(b) == rc: >- return idx >- idx = idx + 1 >- return 0 >- else: >- return OkCancelWindow(self.screen, title, text) >+ elif type == "custom": >+ tmpbut = [] >+ for but in custom_buttons: >+ tmpbut.append(string.replace(but,"_","")) >+ >+ rc = ButtonChoiceWindow(self.screen, title, text, width=60, >+ buttons=tmpbut) >+ >+ idx = 0 >+ for b in tmpbut: >+ if string.lower(b) == rc: >+ return idx >+ idx = idx + 1 >+ return 0 >+ else: >+ return OkCancelWindow(self.screen, title, text) > > def detailedMessageWindow(self, title, text, longText=None, type="ok", > default=None, custom_icon=None, >@@ -604,7 +604,7 @@ class InstallInterface: > > > def waitWindow(self, title, text): >- return WaitWindow(self.screen, title, text) >+ return WaitWindow(self.screen, title, text) > > def beep(self): > # no-op. could call newtBell() if it was bound >@@ -623,8 +623,8 @@ class InstallInterface: > self.screen = screen > > def shutdown(self): >- self.screen.finish() >- self.screen = None >+ self.screen.finish() >+ self.screen = None > > def suspend(self): > self.screen.suspend() >@@ -633,13 +633,13 @@ class InstallInterface: > self.screen.resume() > > def __init__(self): >- signal.signal(signal.SIGINT, signal.SIG_IGN) >- signal.signal(signal.SIGTSTP, signal.SIG_IGN) >- self.screen = SnackScreen() >+ signal.signal(signal.SIGINT, signal.SIG_IGN) >+ signal.signal(signal.SIGTSTP, signal.SIG_IGN) >+ self.screen = SnackScreen() > > def __del__(self): >- if self.screen: >- self.screen.finish() >+ if self.screen: >+ self.screen.finish() > > def isRealConsole(self): > """Returns True if this is a _real_ console that can do things, False >@@ -663,8 +663,8 @@ class InstallInterface: > "English." % (instLang.getCurrent(),), > buttons=[TEXT_OK_BUTTON]) > >- if not self.isRealConsole(): >- self.screen.suspendCallback(spawnShell, self.screen) >+ if not self.isRealConsole(): >+ self.screen.suspendCallback(spawnShell, self.screen) > > # drop into the python debugger on ctrl-z if we're running in test mode > if flags.debug or flags.test: >@@ -679,22 +679,22 @@ class InstallInterface: > anaconda.id.fsset.registerProgressWindow(self.progressWindow) > anaconda.id.fsset.registerWaitWindow(self.waitWindow) > >- parted.exception_set_handler(self.partedExceptionWindow) >+ parted.exception_set_handler(self.partedExceptionWindow) > >- lastrc = INSTALL_OK >- (step, instance) = anaconda.dispatch.currentStep() >- while step: >- (file, classNames) = stepToClasses[step] >+ lastrc = INSTALL_OK >+ (step, instance) = anaconda.dispatch.currentStep() >+ while step: >+ (file, classNames) = stepToClasses[step] > >- if type(classNames) != type(()): >- classNames = (classNames,) >+ if type(classNames) != type(()): >+ classNames = (classNames,) > >- if lastrc == INSTALL_OK: >- step = 0 >- else: >- step = len(classNames) - 1 >+ if lastrc == INSTALL_OK: >+ step = 0 >+ else: >+ step = len(classNames) - 1 > >- while step >= 0 and step < len(classNames): >+ while step >= 0 and step < len(classNames): > # reget the args. they could change (especially direction) > (foo, args) = anaconda.dispatch.currentStep() > nextWindow = None >@@ -718,37 +718,37 @@ class InstallInterface: > if rc == string.lower(_("Exit")): > sys.exit(0) > >- win = nextWindow() >+ win = nextWindow() > >- #log.info("TUI running step %s (class %s, file %s)" % >- #(step, file, classNames)) >+ #log.info("TUI running step %s (class %s, file %s)" % >+ #(step, file, classNames)) > > rc = win(self.screen, instance) > >- if rc == INSTALL_NOOP: >- rc = lastrc >+ if rc == INSTALL_NOOP: >+ rc = lastrc > >- if rc == INSTALL_BACK: >- step = step - 1 >+ if rc == INSTALL_BACK: >+ step = step - 1 > anaconda.dispatch.dir = DISPATCH_BACK >- elif rc == INSTALL_OK: >- step = step + 1 >+ elif rc == INSTALL_OK: >+ step = step + 1 > anaconda.dispatch.dir = DISPATCH_FORWARD > >- lastrc = rc >+ lastrc = rc > >- if step == -1: >+ if step == -1: > if not anaconda.dispatch.canGoBack(): > ButtonChoiceWindow(self.screen, _("Cancelled"), > _("I can't go to the previous step " > "from here. You will have to try " > "again."), > buttons=[_("OK")]) >- anaconda.dispatch.gotoPrev() >- else: >- anaconda.dispatch.gotoNext() >+ anaconda.dispatch.gotoPrev() >+ else: >+ anaconda.dispatch.gotoNext() > >- (step, args) = anaconda.dispatch.currentStep() >+ (step, args) = anaconda.dispatch.currentStep() > > self.screen.finish() > >diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py >index ba02c53..1f70f44 100644 >--- a/textw/bootloader_text.py >+++ b/textw/bootloader_text.py >@@ -41,7 +41,7 @@ class BootloaderChoiceWindow: > blradio = RadioGroup() > grub = blradio.add(_("Use GRUB Boot Loader"), "grub", useGrub) > skipbl = blradio.add(_("No Boot Loader"), "nobl", noBl) >- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON ] ) >+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON ] ) > > grid = GridFormHelp(screen, _("Boot Loader Configuration"), > "btloadinstall", 1, 5) >@@ -61,16 +61,16 @@ class BootloaderChoiceWindow: > > 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 " >+ _("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?"), >- [ (_("Yes"), "yes"), (_("No"), "no") ], >- width = 50) >+ "Are you sure you want to skip boot loader " >+ "installation?"), >+ [ (_("Yes"), "yes"), (_("No"), "no") ], >+ width = 50) > if rc == "no": > continue > anaconda.dispatch.skipStep("instbootloader", skip = (rc == "yes")) >@@ -90,30 +90,30 @@ class BootloaderChoiceWindow: > class BootloaderAppendWindow: > > def __call__(self, screen, anaconda): >- if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP >+ if anaconda.dispatch.stepInSkipList("instbootloader"): 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.")) >+ 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.")) > >- entry = Entry(48, scroll = 1, returnExit = 1) >- entry.set(anaconda.id.bootloader.args.get()) >+ entry = Entry(48, scroll = 1, returnExit = 1) >+ entry.set(anaconda.id.bootloader.args.get()) > > cb = Checkbox(_("Force use of LBA32 (not normally required)")) > if anaconda.id.bootloader.forceLBA32: > cb.setValue("*") > >- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON ] ) >+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON ] ) > >- grid = GridFormHelp(screen, _("Boot Loader Configuration"), "kernelopts", 1, 5) >- grid.add(t, 0, 0, padding = (0, 0, 0, 1)) >+ grid = GridFormHelp(screen, _("Boot Loader Configuration"), "kernelopts", 1, 5) >+ grid.add(t, 0, 0, padding = (0, 0, 0, 1)) > >- grid.add(entry, 0, 2, padding = (0, 0, 0, 1)) >+ grid.add(entry, 0, 2, padding = (0, 0, 0, 1)) > grid.add(cb, 0, 3, padding = (0,0,0,1)) >- grid.add(buttons, 0, 4, growx = 1) >+ grid.add(buttons, 0, 4, growx = 1) > > while 1: > result = grid.run() >@@ -142,39 +142,39 @@ class BootloaderAppendWindow: > > class BootloaderLocationWindow: > def __call__(self, screen, anaconda): >- if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP >+ if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP > >- choices = anaconda.id.fsset.bootloaderChoices(anaconda.id.diskset, anaconda.id.bootloader) >- if len(choices.keys()) == 1: >- anaconda.id.bootloader.setDevice(choices[choices.keys()[0]][0]) >- return INSTALL_NOOP >+ choices = anaconda.id.fsset.bootloaderChoices(anaconda.id.diskset, anaconda.id.bootloader) >+ if len(choices.keys()) == 1: >+ anaconda.id.bootloader.setDevice(choices[choices.keys()[0]][0]) >+ return INSTALL_NOOP > if len(choices.keys()) == 0: > return INSTALL_NOOP > > format = "/dev/%-11s %s" > locations = [] > devices = [] >- default = 0 >+ default = 0 > > keys = choices.keys() > keys.reverse() > for key in keys: > (device, desc) = choices[key] >- if device == anaconda.id.bootloader.getDevice(): >- default = len(locations) >+ if device == anaconda.id.bootloader.getDevice(): >+ default = len(locations) > locations.append (format % (device, _(desc))) > 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 > >- anaconda.id.bootloader.setDevice(devices[sel]) >+ anaconda.id.bootloader.setDevice(devices[sel]) > > return INSTALL_OK > >@@ -193,37 +193,37 @@ class BootloaderImagesWindow: > > > def editItem(self, screen, partition, itemLabel, allowNone=0): >- devLabel = Label(_("Device") + ":") >- bootLabel = Label(_("Boot label") + ":") >- device = Label("/dev/" + partition) >+ devLabel = Label(_("Device") + ":") >+ bootLabel = Label(_("Boot label") + ":") >+ device = Label("/dev/" + partition) > newLabel = Entry (20, scroll = 1, returnExit = 1, text = itemLabel) > >- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Clear"), "clear"), >- (_("Cancel"), "cancel")]) >- >- subgrid = Grid(2, 2) >- subgrid.setField(devLabel, 0, 0, anchorLeft = 1) >- subgrid.setField(device, 1, 0, padding = (1, 0, 0, 0), anchorLeft = 1) >- subgrid.setField(bootLabel, 0, 1, anchorLeft = 1) >- subgrid.setField(newLabel, 1, 1, padding = (1, 0, 0, 0), anchorLeft = 1) >- g = GridFormHelp(screen, _("Edit Boot Label"), "bootlabel", 1, 2) >- g.add(subgrid, 0, 0, padding = (0, 0, 0, 1)) >- g.add(buttons, 0, 1, growx = 1) >- >- result = "" >- while (result != TEXT_OK_CHECK and result != TEXT_F12_CHECK and result != newLabel): >- result = g.run() >- >- if (buttons.buttonPressed(result)): >- result = buttons.buttonPressed(result) >- >- if (result == "cancel"): >- screen.popWindow () >- return itemLabel >- elif (result == "clear"): >- newLabel.set("") >+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Clear"), "clear"), >+ (_("Cancel"), "cancel")]) >+ >+ subgrid = Grid(2, 2) >+ subgrid.setField(devLabel, 0, 0, anchorLeft = 1) >+ subgrid.setField(device, 1, 0, padding = (1, 0, 0, 0), anchorLeft = 1) >+ subgrid.setField(bootLabel, 0, 1, anchorLeft = 1) >+ subgrid.setField(newLabel, 1, 1, padding = (1, 0, 0, 0), anchorLeft = 1) >+ g = GridFormHelp(screen, _("Edit Boot Label"), "bootlabel", 1, 2) >+ g.add(subgrid, 0, 0, padding = (0, 0, 0, 1)) >+ g.add(buttons, 0, 1, growx = 1) >+ >+ result = "" >+ while (result != TEXT_OK_CHECK and result != TEXT_F12_CHECK and result != newLabel): >+ result = g.run() >+ >+ if (buttons.buttonPressed(result)): >+ result = buttons.buttonPressed(result) >+ >+ if (result == "cancel"): >+ screen.popWindow () >+ return itemLabel >+ elif (result == "clear"): >+ newLabel.set("") > elif (result == TEXT_OK_CHECK or result == TEXT_F12_CHECK or result == newLabel): >- if not allowNone and not newLabel.value(): >+ if not allowNone and not newLabel.value(): > ButtonChoiceWindow (screen, _("Invalid Boot Label"), > _("Boot label may not be empty."), > [ TEXT_OK_BUTTON ]) >@@ -235,103 +235,103 @@ class BootloaderImagesWindow: > [ TEXT_OK_BUTTON ]) > result = "" > >- screen.popWindow() >+ screen.popWindow() > >- return newLabel.value() >+ return newLabel.value() > > def formatDevice(self, label, device, default): >- if default == device: >- default = '*' >- else: >- default = "" >+ if default == device: >+ default = '*' >+ else: >+ default = "" > > if not label: > label = "" >- >- return " %-4s %-25s %-25s" % ( default, label, "/dev/" + device) >+ >+ return " %-4s %-25s %-25s" % ( default, label, "/dev/" + device) > > def __call__(self, screen, anaconda): >- if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP >+ if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP > > self.bl = anaconda.id.bootloader > >- images = self.bl.images.getImages() >- default = self.bl.images.getDefault() >+ images = self.bl.images.getImages() >+ default = self.bl.images.getDefault() > >- listboxLabel = Label( "%-7s %-25s %-12s" % >- ( _("Default"), _("Boot label"), _("Device"))) >- listbox = Listbox(5, scroll = 1, returnExit = 1) >+ listboxLabel = Label( "%-7s %-25s %-12s" % >+ ( _("Default"), _("Boot label"), _("Device"))) >+ listbox = Listbox(5, scroll = 1, returnExit = 1) > >- sortedKeys = images.keys() >- sortedKeys.sort() >+ sortedKeys = images.keys() >+ sortedKeys.sort() > >- for dev in sortedKeys: >- (label, longlabel, isRoot) = images[dev] >+ for dev in sortedKeys: >+ (label, longlabel, isRoot) = images[dev] > if not self.bl.useGrub(): > listbox.append(self.formatDevice(label, dev, default), dev) > else: > listbox.append(self.formatDevice(longlabel, dev, default), dev) > >- listbox.setCurrent(dev) >+ listbox.setCurrent(dev) > >- buttons = ButtonBar(screen, [ TEXT_OK_BUTTON, (_("Edit"), "edit"), >- TEXT_BACK_BUTTON ] ) >+ 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.") % (productName,)) >+ 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.") % (productName,)) > >- g = GridFormHelp(screen, _("Boot Loader Configuration"), >- "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) >- g.add(buttons, 0, 3, growx = 1) >+ g = GridFormHelp(screen, _("Boot Loader Configuration"), >+ "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) >+ g.add(buttons, 0, 3, growx = 1) > g.addHotKey("F2") > g.addHotKey("F4") > screen.pushHelpLine(_(" <Space> select | <F2> select default | <F4> delete | <F12> next screen>")) > >- rootdev = anaconda.id.fsset.getEntryByMountPoint("/").device.getDevice() >+ rootdev = anaconda.id.fsset.getEntryByMountPoint("/").device.getDevice() > >- result = None >- while (result != TEXT_OK_CHECK and result != TEXT_BACK_CHECK and result != TEXT_F12_CHECK): >- result = g.run() >- if (buttons.buttonPressed(result)): >- result = buttons.buttonPressed(result) >+ result = None >+ while (result != TEXT_OK_CHECK and result != TEXT_BACK_CHECK and result != TEXT_F12_CHECK): >+ result = g.run() >+ if (buttons.buttonPressed(result)): >+ result = buttons.buttonPressed(result) > >- if (result == "edit" or result == listbox): >- item = listbox.current() >- (label, longlabel, type) = images[item] >+ if (result == "edit" or result == listbox): >+ item = listbox.current() >+ (label, longlabel, type) = images[item] > if self.bl.useGrub(): > label = longlabel > if label == None: > label = "" > >- label = self.editItem(screen, item, label, allowNone = (rootdev != item and item != default)) >- images[item] = (label, label, type) >- if (default == item and not label): >- default = "" >- listbox.replace(self.formatDevice(label, item, default), item) >- listbox.setCurrent(item) >- elif result == "F2": >- item = listbox.current() >- (label, longlabel, isRoot) = images[item] >+ label = self.editItem(screen, item, label, allowNone = (rootdev != item and item != default)) >+ images[item] = (label, label, type) >+ if (default == item and not label): >+ default = "" >+ listbox.replace(self.formatDevice(label, item, default), item) >+ listbox.setCurrent(item) >+ elif result == "F2": >+ item = listbox.current() >+ (label, longlabel, isRoot) = images[item] > if self.bl.useGrub(): > label = longlabel > >- if (label): >- if (default): >- (oldLabel, oldLong, oldIsRoot) = images[default] >+ if (label): >+ if (default): >+ (oldLabel, oldLong, oldIsRoot) = images[default] > if self.bl.useGrub(): > oldLabel = oldLong >- listbox.replace(self.formatDevice(oldLabel, default, >- ""), default) >- default = item >- listbox.replace(self.formatDevice(label, item, default), >- item) >- listbox.setCurrent(item) >+ listbox.replace(self.formatDevice(oldLabel, default, >+ ""), default) >+ default = item >+ listbox.replace(self.formatDevice(label, item, default), >+ item) >+ listbox.setCurrent(item) > elif result == "F4": > item = listbox.current() > >@@ -351,21 +351,21 @@ class BootloaderImagesWindow: > > > screen.popHelpLine() >- screen.popWindow() >+ screen.popWindow() > >- if (result == TEXT_BACK_CHECK): >- return INSTALL_BACK >+ if (result == TEXT_BACK_CHECK): >+ return INSTALL_BACK > > if not default: > default = rootdev > > # copy our version over > self.bl.images.images = {} >- for (dev, (label, longlabel, isRoot)) in images.items(): >+ for (dev, (label, longlabel, isRoot)) in images.items(): > self.bl.images.images[dev] = (label, longlabel, isRoot) >- self.bl.images.setDefault(default) >+ self.bl.images.setDefault(default) > >- return INSTALL_OK >+ return INSTALL_OK > > class BootloaderPasswordWindow: > def usepasscb(self, *args): >@@ -376,7 +376,7 @@ class BootloaderPasswordWindow: > self.entry2.setFlags(FLAG_DISABLED, flag) > > def __call__(self, screen, anaconda): >- if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP >+ if anaconda.dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP > > intf = anaconda.intf > self.bl = anaconda.id.bootloader >@@ -384,17 +384,17 @@ class BootloaderPasswordWindow: > if not self.bl.useGrub(): > return INSTALL_NOOP > >- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON]) >+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON]) > >- text = TextboxReflowed(55, >- _("A boot loader password prevents users from passing arbitrary " >+ 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) >+ g = GridFormHelp(screen, _("Boot Loader Configuration"), >+ "grubpasswd", 1, 6) >+ g.add(text, 0, 0, (0,0,0,1), anchorLeft = 1) > > > self.checkbox = Checkbox(_("Use a GRUB Password")) >@@ -404,7 +404,7 @@ class BootloaderPasswordWindow: > self.checkbox.setValue("*") > > pw = self.bl.pure >- if not pw: pw = "" >+ if not pw: pw = "" > > self.entry1 = Entry (24, password = 1, text = pw) > self.entry2 = Entry (24, password = 1, text = pw) >@@ -423,11 +423,11 @@ class BootloaderPasswordWindow: > while 1: > result = g.run() > >- if (buttons.buttonPressed(result)): >- result = buttons.buttonPressed(result) >+ if (buttons.buttonPressed(result)): >+ result = buttons.buttonPressed(result) > >- if result == TEXT_BACK_CHECK: >- screen.popWindow() >+ if result == TEXT_BACK_CHECK: >+ screen.popWindow() > return INSTALL_BACK > > if not self.checkbox.selected(): >diff --git a/textw/grpselect_text.py b/textw/grpselect_text.py >index f74b54c..edf72fb 100644 >--- a/textw/grpselect_text.py >+++ b/textw/grpselect_text.py >@@ -85,8 +85,8 @@ class GroupSelectionWindow: > bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) > g.add(bb, 0, 3, growx = 1) > >- g.addHotKey("F2") >- screen.pushHelpLine (_("<Space>,<+>,<-> selection | <F2> Group Details | <F12> next screen")) >+ g.addHotKey("F2") >+ screen.pushHelpLine (_("<Space>,<+>,<-> selection | <F2> Group Details | <F12> next screen")) > > while 1: > result = g.run() >@@ -94,23 +94,23 @@ class GroupSelectionWindow: > if result != "F2": > break > >- grp = ct.getCurrent() >+ grp = ct.getCurrent() > pkgs = grp.default_packages.keys() + grp.optional_packages.keys() > if len(pkgs) == 0: > ButtonChoiceWindow(screen, _("Error"), > _("No optional packages to select")) > continue > >- # if current group is not selected then select it first >- newSelection = 0 >- lst = ct.getSelection() >- if grp not in lst: >- newSelection = 1 >+ # if current group is not selected then select it first >+ newSelection = 0 >+ lst = ct.getSelection() >+ if grp not in lst: >+ newSelection = 1 > self.ayum.selectGroup(grp.groupid) >- ct.setEntryValue(grp, True) >+ ct.setEntryValue(grp, True) > >- # do group details >- gct = CheckboxTree(height = 8, scroll = 1) >+ # do group details >+ gct = CheckboxTree(height = 8, scroll = 1) > > orig = {} > pkgs.sort() >@@ -118,23 +118,23 @@ class GroupSelectionWindow: > orig[pkg] = self.ayum.isPackageInstalled(pkg) > gct.append("%s" %(pkg,), pkg, orig[pkg]) > >- bb2 = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_CANCEL_BUTTON)) >+ bb2 = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_CANCEL_BUTTON)) > >- g2 = GridFormHelp (screen, _("Package Group Details"), "", 1, 4) >+ g2 = GridFormHelp (screen, _("Package Group Details"), "", 1, 4) > >- g2.add (gct, 0, 1, (0, 0, 0, 1)) >- g2.add (bb2, 0, 3, growx = 1) >+ g2.add (gct, 0, 1, (0, 0, 0, 1)) >+ g2.add (bb2, 0, 3, growx = 1) > >- rc2 = g2.runOnce() >- if bb2.buttonPressed(rc2) == TEXT_CANCEL_CHECK: >- # unselect group if necessary >- if newSelection: >- ct.setEntryValue(grp, False) >+ rc2 = g2.runOnce() >+ if bb2.buttonPressed(rc2) == TEXT_CANCEL_CHECK: >+ # unselect group if necessary >+ if newSelection: >+ ct.setEntryValue(grp, False) > self.ayum.deselectGroup(grp.groupid) > >- else: >- # reflect new packages selected >- selected = gct.getSelection() >+ else: >+ # reflect new packages selected >+ selected = gct.getSelection() > for (opkg, osel) in orig.items(): > if opkg in selected and not osel: > self.__selectPackage(grp, opkg) >diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py >index 52ecffb..86be3e4 100644 >--- a/textw/keyboard_text.py >+++ b/textw/keyboard_text.py >@@ -32,14 +32,14 @@ log = logging.getLogger("anaconda") > class KeyboardWindow: > def __call__(self, screen, anaconda): > if flags.serial or flags.virtpconsole: >- return INSTALL_NOOP >+ return INSTALL_NOOP > keyboards = anaconda.id.keyboard.modelDict.keys() > keyboards.sort () > >- if anaconda.id.keyboard.beenset: >- default = anaconda.id.keyboard.get () >- else: >- default = anaconda.id.instLanguage.getDefaultKeyboard() >+ if anaconda.id.keyboard.beenset: >+ default = anaconda.id.keyboard.get () >+ else: >+ default = anaconda.id.instLanguage.getDefaultKeyboard() > > if default not in keyboards: > default = 'us' >@@ -59,9 +59,9 @@ class KeyboardWindow: > anaconda.id.keyboard.activate() > > # FIXME: eventually, kbd.activate will do this >- try: >- isys.loadKeymap(keyboards[choice]) >- except SystemError, (errno, msg): >- log.error("Could not install keymap %s: %s" % (keyboards[choice], msg)) >+ try: >+ isys.loadKeymap(keyboards[choice]) >+ except SystemError, (errno, msg): >+ log.error("Could not install keymap %s: %s" % (keyboards[choice], msg)) > return INSTALL_OK > >diff --git a/textw/language_text.py b/textw/language_text.py >index 8b920b5..1ec0275 100644 >--- a/textw/language_text.py >+++ b/textw/language_text.py >@@ -37,16 +37,16 @@ class LanguageWindow: > current = id.instLanguage.getCurrent() > > height = min((8, len(languages))) >- buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] >+ buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] > > translated = [] > for lang in languages: > translated.append ((_(lang), id.instLanguage.getNickByName(lang))) > (button, choice) = \ > ListboxChoiceWindow(screen, _("Language Selection"), >- _("What language would you like to use during the " >- "installation process?"), translated, >- buttons, width = 30, default = _(current), scroll = 1, >+ _("What language would you like to use during the " >+ "installation process?"), translated, >+ buttons, width = 30, default = _(current), scroll = 1, > height = height, help = "lang") > > if button == TEXT_BACK_CHECK: >@@ -61,10 +61,10 @@ class LanguageWindow: > id.timezone.setTimezoneInfo(id.instLanguage.getDefaultTimeZone()) > return INSTALL_OK > >- id.instLanguage.setRuntimeLanguage(choice) >- id.instLanguage.setDefault(choice) >+ id.instLanguage.setRuntimeLanguage(choice) >+ id.instLanguage.setDefault(choice) > id.timezone.setTimezoneInfo(id.instLanguage.getDefaultTimeZone()) > >- anaconda.intf.drawFrame() >+ anaconda.intf.drawFrame() > > return INSTALL_OK >diff --git a/textw/partition_text.py b/textw/partition_text.py >index 4083107..440bbcb 100644 >--- a/textw/partition_text.py >+++ b/textw/partition_text.py >@@ -73,30 +73,30 @@ class PartitionWindow: > # independent bits... > self.lb.clear() > >- # first do LVM >+ # first do LVM > lvmrequests = self.partitions.getLVMRequests() > if lvmrequests: > for vgname in lvmrequests.keys(): >- vgrequest = self.partitions.getRequestByVolumeGroupName(vgname) >- size = vgrequest.getActualSize(self.partitions, self.diskset) >- device = "VG %s" % (vgname,) >+ vgrequest = self.partitions.getRequestByVolumeGroupName(vgname) >+ size = vgrequest.getActualSize(self.partitions, self.diskset) >+ device = "VG %s" % (vgname,) > self.lb.append(["%s" % (device,), > "", "", "%dM" %(size), > "VolGroup", ""], str(vgrequest.uniqueID), > [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT]) >- >- for lvrequest in lvmrequests[vgname]: >- lvdevice = "LV %s" % (lvrequest.logicalVolumeName,) >- if lvrequest.fstype and lvrequest.mountpoint: >- mntpt = lvrequest.mountpoint >- else: >- mntpt = "" >- lvsize = lvrequest.getActualSize(self.partitions, self.diskset) >+ >+ for lvrequest in lvmrequests[vgname]: >+ lvdevice = "LV %s" % (lvrequest.logicalVolumeName,) >+ if lvrequest.fstype and lvrequest.mountpoint: >+ mntpt = lvrequest.mountpoint >+ else: >+ mntpt = "" >+ lvsize = lvrequest.getActualSize(self.partitions, self.diskset) > ptype = lvrequest.fstype.getName() >- self.lb.append(["%s" %(lvdevice), >- "", "", "%dM" %(lvsize), >- "%s" %(ptype), "%s" %(mntpt)], str(lvrequest.uniqueID), >- [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT]) >+ self.lb.append(["%s" %(lvdevice), >+ "", "", "%dM" %(lvsize), >+ "%s" %(ptype), "%s" %(mntpt)], str(lvrequest.uniqueID), >+ [LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT]) > > > # next, add the raid partitions >@@ -114,13 +114,13 @@ class PartitionWindow: > else: > ptype = _("None") > >- try: >+ try: > self.raidminors[request.raidminor] = True >- device = "/dev/md%d" % (request.raidminor,) >- except: >+ device = "/dev/md%d" % (request.raidminor,) >+ except: > minor = self._findFirstUnused(self.raidminors) > self.raidminors[minor] = True >- device = _("RAID Device %s" %(str(minor))) >+ device = _("RAID Device %s" %(str(minor))) > > size = request.size > self.lb.append(["%s" %(device), >@@ -225,24 +225,24 @@ class PartitionWindow: > # XXX need some way to stay at the same place in the list after > # repopulating > >- # XXXX - Backup some info which doPartitioning munges if it fails >- origInfoDict = {} >- for request in self.partitions.requests: >- try: >- origInfoDict[request.uniqueID] = (request.requestSize, request.currentDrive) >- except: >- pass >+ # XXXX - Backup some info which doPartitioning munges if it fails >+ origInfoDict = {} >+ for request in self.partitions.requests: >+ try: >+ origInfoDict[request.uniqueID] = (request.requestSize, request.currentDrive) >+ except: >+ pass > > try: > doPartitioning(self.diskset, self.partitions) > rc = 0 > except PartitioningError, msg: >- try: >- for request in self.partitions.requests: >- if request.uniqueID in origInfoDict.keys(): >- (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID] >- except: >- log.error("Failed to restore original info") >+ try: >+ for request in self.partitions.requests: >+ if request.uniqueID in origInfoDict.keys(): >+ (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID] >+ except: >+ log.error("Failed to restore original info") > > self.intf.messageWindow(_("Error Partitioning"), > _("Could not allocate requested partitions: %s.") % (msg)) >@@ -564,45 +564,45 @@ class PartitionWindow: > return (entry, subgrid) > > def fsOptionsGrid(self, origrequest, newfstype): >- subgrid = Grid(2, 4) >- # filesystem type selection >- srow = 0 >- typeLbl = Label(_("File System Type:")) >- subgrid.setField(typeLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >- ptype = origrequest.fstype.getName() >- if ptype == "foreign": >- part = get_partition_by_name(self.diskset.disks, origrequest.device) >+ subgrid = Grid(2, 4) >+ # filesystem type selection >+ srow = 0 >+ typeLbl = Label(_("File System Type:")) >+ subgrid.setField(typeLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >+ ptype = origrequest.fstype.getName() >+ if ptype == "foreign": >+ part = get_partition_by_name(self.diskset.disks, origrequest.device) > if part is not None: > ptype = map_foreign_to_fsname(part.native_type) > else: > pytype = _("Foreign") >- type = Label(ptype) >- subgrid.setField(type, 1, srow, (0,0,0,1), anchorRight = 1) >- srow = srow +1 >- if origrequest.type != REQUEST_NEW and origrequest.fslabel: >- fsLbl = Label(_("File System Label:")) >- subgrid.setField(fsLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >- label = Label(origrequest.fslabel) >- subgrid.setField(label, 1, srow, (0,0,0,1), anchorRight = 1) >- srow = srow + 1 >- >- sizeLbl = Label(_("Size (MB):")) >- subgrid.setField(sizeLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >- size = Label("%s" %(int(origrequest.size))) >- subgrid.setField(size, 1, srow, (0,0,0,1), anchorRight = 1) >- srow = srow + 1 >- tmpLbl = Label(_("File System Option:")) >- subgrid.setField(tmpLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >- if origrequest.format: >- fsoptLbl = Label(_("Format as %s") % (newfstype.getName())) >- elif origrequest.migrate: >- fsoptLbl = Label(_("Migrate to %s") %(newfstype.getName())) >- else: >- fsoptLbl = Label(_("Leave unchanged")) >- subgrid.setField(fsoptLbl, 1, srow, (0,0,0,1), anchorLeft = 1) >- >- return (subgrid, fsoptLbl, type) >- >+ type = Label(ptype) >+ subgrid.setField(type, 1, srow, (0,0,0,1), anchorRight = 1) >+ srow = srow +1 >+ if origrequest.type != REQUEST_NEW and origrequest.fslabel: >+ fsLbl = Label(_("File System Label:")) >+ subgrid.setField(fsLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >+ label = Label(origrequest.fslabel) >+ subgrid.setField(label, 1, srow, (0,0,0,1), anchorRight = 1) >+ srow = srow + 1 >+ >+ sizeLbl = Label(_("Size (MB):")) >+ subgrid.setField(sizeLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >+ size = Label("%s" %(int(origrequest.size))) >+ subgrid.setField(size, 1, srow, (0,0,0,1), anchorRight = 1) >+ srow = srow + 1 >+ tmpLbl = Label(_("File System Option:")) >+ subgrid.setField(tmpLbl, 0, srow, (0,0,0,1), anchorLeft = 1) >+ if origrequest.format: >+ fsoptLbl = Label(_("Format as %s") % (newfstype.getName())) >+ elif origrequest.migrate: >+ fsoptLbl = Label(_("Migrate to %s") %(newfstype.getName())) >+ else: >+ fsoptLbl = Label(_("Leave unchanged")) >+ subgrid.setField(fsoptLbl, 1, srow, (0,0,0,1), anchorLeft = 1) >+ >+ return (subgrid, fsoptLbl, type) >+ > > def fsOptionsDialog(self, origrequest, format, migrate, newfstype): > >@@ -759,11 +759,11 @@ class PartitionWindow: > > fsoptLbl = None > >- elif origrequest.type == REQUEST_VG: >- self.intf.messageWindow(_("Not Supported"), >- _("You can only edit LVM Volume Groups " >- "in the graphical installer.")) >- return >+ elif origrequest.type == REQUEST_VG: >+ self.intf.messageWindow(_("Not Supported"), >+ _("You can only edit LVM Volume Groups " >+ "in the graphical installer.")) >+ return > > elif (origrequest.type == REQUEST_LV or origrequest.type == REQUEST_PREEXIST) and origrequest.fstype: > >@@ -938,11 +938,11 @@ class PartitionWindow: > > # isNew implies that this request has never been successfully used before > def editRaidRequest(self, raidrequest, isNew = 0): >- preexist = raidrequest and raidrequest.preexist >- if preexist: >- tmpstr = _("Edit RAID Device") >- else: >- tmpstr = _("Make RAID Device") >+ preexist = raidrequest and raidrequest.preexist >+ if preexist: >+ tmpstr = _("Edit RAID Device") >+ else: >+ tmpstr = _("Make RAID Device") > poplevel = GridFormHelp(self.screen, tmpstr, "makeraid", 1, 6) > > # mount point entry >@@ -951,10 +951,10 @@ class PartitionWindow: > poplevel.add(mountgrid, 0, row) > row = row + 1 > >- # initialize holder for temporary mount point value >- self.oldMount = None >+ # initialize holder for temporary mount point value >+ self.oldMount = None > >- if preexist: >+ if preexist: > # set some defaults > format = raidrequest.format > migrate = raidrequest.migrate >@@ -962,54 +962,54 @@ class PartitionWindow: > > (subgrid, fsoptLbl, fstypeLbl) = self.fsOptionsGrid(raidrequest, newfstype) > poplevel.add(subgrid, 0, row, (0,1,0,0)) >- self.drivelist = None >- else: >- subgrid = Grid(2, 1) >- (fstype, fsgrid) = self.makeFsList(raidrequest, ignorefs = ["software RAID", "PPC PReP Boot", "Apple Bootstrap"]) >- subgrid.setField(fsgrid, 0, 0, anchorLeft = 1, anchorTop=1) >- (raidtype, raidgrid) = self.makeRaidList(raidrequest) >- subgrid.setField(raidgrid, 1, 0, (2,0,0,0), anchorRight=1, anchorTop=1) >- poplevel.add(subgrid, 0, row, (0,1,0,0)) >- >- row = row + 1 >- drivegrid = Grid(2, 1) >- >- #Let's see if we have any RAID partitions to make a RAID device with >- avail = self.partitions.getAvailRaidPartitions(raidrequest, self.diskset) >- >- #If we don't, then tell the user that none exist >- if len(avail) < 2: >- ButtonChoiceWindow (self.screen, _("No RAID partitions"), >- _("At least two software RAID partitions are needed."), >- [ TEXT_OK_BUTTON ]) >- return >- >- (self.drivelist, drivesubgrid) = self.makeRaidDriveList(raidrequest) >- drivegrid.setField(drivesubgrid, 0, 0, (0,0,4,0), anchorLeft = 1, anchorTop = 1) >- >- miscgrid = Grid(1, 2) >- (spares, sparegrid) = self.makeSpareEntry(raidrequest) >- miscgrid.setField(sparegrid, 0, 0, anchorRight=1, anchorTop=1) >- >- if raidrequest.fstype and raidrequest.fstype.isFormattable(): >- format = Checkbox(_("Format partition?")) >- miscgrid.setField(format, 0, 1) >- else: >- format = None >- >- if raidrequest.format == 1 or raidrequest.format == None: >- format.setValue("*") >- >- drivegrid.setField(miscgrid, 1, 0, anchorTop=1) >- poplevel.add(drivegrid, 0, row, (0,1,0,0)) >+ self.drivelist = None >+ else: >+ subgrid = Grid(2, 1) >+ (fstype, fsgrid) = self.makeFsList(raidrequest, ignorefs = ["software RAID", "PPC PReP Boot", "Apple Bootstrap"]) >+ subgrid.setField(fsgrid, 0, 0, anchorLeft = 1, anchorTop=1) >+ (raidtype, raidgrid) = self.makeRaidList(raidrequest) >+ subgrid.setField(raidgrid, 1, 0, (2,0,0,0), anchorRight=1, anchorTop=1) >+ poplevel.add(subgrid, 0, row, (0,1,0,0)) >+ >+ row = row + 1 >+ drivegrid = Grid(2, 1) >+ >+ #Let's see if we have any RAID partitions to make a RAID device with >+ avail = self.partitions.getAvailRaidPartitions(raidrequest, self.diskset) >+ >+ #If we don't, then tell the user that none exist >+ if len(avail) < 2: >+ ButtonChoiceWindow (self.screen, _("No RAID partitions"), >+ _("At least two software RAID partitions are needed."), >+ [ TEXT_OK_BUTTON ]) >+ return >+ >+ (self.drivelist, drivesubgrid) = self.makeRaidDriveList(raidrequest) >+ drivegrid.setField(drivesubgrid, 0, 0, (0,0,4,0), anchorLeft = 1, anchorTop = 1) >+ >+ miscgrid = Grid(1, 2) >+ (spares, sparegrid) = self.makeSpareEntry(raidrequest) >+ miscgrid.setField(sparegrid, 0, 0, anchorRight=1, anchorTop=1) >+ >+ if raidrequest.fstype and raidrequest.fstype.isFormattable(): >+ format = Checkbox(_("Format partition?")) >+ miscgrid.setField(format, 0, 1) >+ else: >+ format = None >+ >+ if raidrequest.format == 1 or raidrequest.format == None: >+ format.setValue("*") >+ >+ drivegrid.setField(miscgrid, 1, 0, anchorTop=1) >+ poplevel.add(drivegrid, 0, row, (0,1,0,0)) > > row = row + 1 >- if preexist: >+ if preexist: > popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON, > (_("File System Options"), "fsopts"), > TEXT_CANCEL_BUTTON)) >- else: >- popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON,TEXT_CANCEL_BUTTON)) >+ else: >+ popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON,TEXT_CANCEL_BUTTON)) > poplevel.add(popbb, 0, row, (0,1,0,0), growx = 1) > > while 1: >@@ -1036,47 +1036,47 @@ class PartitionWindow: > > request = copy.copy(raidrequest) > >- if not preexist: >- request.fstype = fstype.current() >- else: >- request.fstype = newfstype >+ if not preexist: >+ request.fstype = fstype.current() >+ else: >+ request.fstype = newfstype > > if request.fstype.isMountable(): > request.mountpoint = self.mount.value() > else: > request.mountpoint = None > >- if not preexist: >- raidmembers = [] >- for drive in self.drivelist.getSelection(): >- id = self.partitions.getRequestByDeviceName(drive).uniqueID >- raidmembers.append(id) >+ if not preexist: >+ raidmembers = [] >+ for drive in self.drivelist.getSelection(): >+ id = self.partitions.getRequestByDeviceName(drive).uniqueID >+ raidmembers.append(id) > >- request.raidmembers = raidmembers >- if invalidInteger(spares.value()): >- self.intf.messageWindow(_("Invalid Entry for RAID Spares"), >- invalidInteger(spares.value())) >- continue >+ request.raidmembers = raidmembers >+ if invalidInteger(spares.value()): >+ self.intf.messageWindow(_("Invalid Entry for RAID Spares"), >+ invalidInteger(spares.value())) >+ continue > >- request.raidspares = int(spares.value()) >- request.raidlevel = raidtype.current() >+ request.raidspares = int(spares.value()) >+ request.raidlevel = raidtype.current() > request.raidminor = self._findFirstUnused(self.raidminors) > self.raidminors[request.raidminor] = True > >- if format: >- request.format = format.selected() >- else: >- request.format = 0 >- >- if request.raidlevel == "RAID0" and request.raidspares > 0: >- self.intf.messageWindow(_("Too many spares"), >- _("You may not use any spares " >- "with a RAID0 array.")) >- continue >- else: >- request.format = format >- request.migrate = migrate >- request.fstype = newfstype >+ if format: >+ request.format = format.selected() >+ else: >+ request.format = 0 >+ >+ if request.raidlevel == "RAID0" and request.raidspares > 0: >+ self.intf.messageWindow(_("Too many spares"), >+ _("You may not use any spares " >+ "with a RAID0 array.")) >+ continue >+ else: >+ request.format = format >+ request.migrate = migrate >+ request.fstype = newfstype > > err = request.sanityCheckRequest(self.partitions) > if err: >@@ -1108,11 +1108,11 @@ class PartitionWindow: > > # isNew implies that this request has never been successfully used before > def editLVRequest(self, lvrequest, isNew = 0): >- preexist = lvrequest and lvrequest.preexist >- if preexist: >- tmpstr = _("Edit Logical Volume") >- else: >- tmpstr = _("Make Logical Volume") >+ preexist = lvrequest and lvrequest.preexist >+ if preexist: >+ tmpstr = _("Edit Logical Volume") >+ else: >+ tmpstr = _("Make Logical Volume") > self.drivelist = None > poplevel = GridFormHelp(self.screen, tmpstr, "makelv", 1, 8) > >@@ -1130,10 +1130,10 @@ class PartitionWindow: > poplevel.add(lvsizegrid, 0, row) > row = row + 1 > >- # initialize holder for temporary mount point value >- self.oldMount = None >+ # initialize holder for temporary mount point value >+ self.oldMount = None > >- if preexist: >+ if preexist: > # set some defaults > format = lvrequest.format > migrate = lvrequest.migrate >@@ -1141,11 +1141,11 @@ class PartitionWindow: > > (subgrid, fsoptLbl, fstypeLbl) = self.fsOptionsGrid(lvrequest, newfstype) > poplevel.add(subgrid, 0, row, (0,1,0,0)) >- self.drivelist = None >- else: >- subgrid = Grid(2, 1) >- (fstype, fsgrid) = self.makeFsList(lvrequest, ignorefs = ["software RAID", "efi", "PPC PReP Boot", "Apple Bootstrap"]) >- subgrid.setField(fsgrid, 0, 0, anchorLeft = 1, anchorTop=1) >+ self.drivelist = None >+ else: >+ subgrid = Grid(2, 1) >+ (fstype, fsgrid) = self.makeFsList(lvrequest, ignorefs = ["software RAID", "efi", "PPC PReP Boot", "Apple Bootstrap"]) >+ subgrid.setField(fsgrid, 0, 0, anchorLeft = 1, anchorTop=1) > > vgs = self.partitions.getLVMVGRequests() > if len(vgs) < 1: >@@ -1155,31 +1155,31 @@ class PartitionWindow: > return > > (vgtype, vggrid) = self.makeVGList(lvrequest) >- subgrid.setField(vggrid, 1, 0, (2,0,0,0), anchorRight=1, anchorTop=1) >- poplevel.add(subgrid, 0, row, (0,1,0,0)) >+ subgrid.setField(vggrid, 1, 0, (2,0,0,0), anchorRight=1, anchorTop=1) >+ poplevel.add(subgrid, 0, row, (0,1,0,0)) > >- row = row + 1 >+ row = row + 1 > >- miscgrid = Grid(1, 3) >+ miscgrid = Grid(1, 3) > >- if lvrequest.fstype and lvrequest.fstype.isFormattable(): >- format = Checkbox(_("Format partition?")) >- miscgrid.setField(format, 0, 1) >- else: >- format = None >+ if lvrequest.fstype and lvrequest.fstype.isFormattable(): >+ format = Checkbox(_("Format partition?")) >+ miscgrid.setField(format, 0, 1) >+ else: >+ format = None > >- if lvrequest.format == 1 or lvrequest.format == None: >- format.setValue("*") >+ if lvrequest.format == 1 or lvrequest.format == None: >+ format.setValue("*") > >- poplevel.add(miscgrid, 0, row, (0,1,0,0)) >+ poplevel.add(miscgrid, 0, row, (0,1,0,0)) > > row = row + 1 >- if preexist: >+ if preexist: > popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON, > (_("File System Options"), "fsopts"), > TEXT_CANCEL_BUTTON)) >- else: >- popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON,TEXT_CANCEL_BUTTON)) >+ else: >+ popbb = ButtonBar(self.screen, (TEXT_OK_BUTTON,TEXT_CANCEL_BUTTON)) > poplevel.add(popbb, 0, row, (0,1,0,0), growx = 1) > > while 1: >@@ -1206,21 +1206,21 @@ class PartitionWindow: > > request = copy.copy(lvrequest) > >- if not preexist: >- request.fstype = fstype.current() >- else: >- request.fstype = newfstype >+ if not preexist: >+ request.fstype = fstype.current() >+ else: >+ request.fstype = newfstype > > if request.fstype.isMountable(): > request.mountpoint = self.mount.value() > else: > request.mountpoint = None > >- if not preexist: >- if format: >- request.format = format.selected() >- else: >- request.format = 0 >+ if not preexist: >+ if format: >+ request.format = format.selected() >+ else: >+ request.format = 0 > > # set the vg > vgreq = vgtype.current() >@@ -1304,10 +1304,10 @@ class PartitionWindow: > request.size = size > request.grow = 0 > request.dev = None >- else: >- request.format = format >- request.migrate = migrate >- request.fstype = newfstype >+ else: >+ request.format = format >+ request.migrate = migrate >+ request.fstype = newfstype > > err = request.sanityCheckRequest(self.partitions) > if err: >@@ -1613,7 +1613,7 @@ class PartitionTypeWindow: > anaconda.dispatch.skipStep("partition", skip = 0) > anaconda.dispatch.skipStep("bootloader", skip = 0) > >- if partmethod_ans != -1: >+ if partmethod_ans != -1: > reviewLayout = anaconda.intf.messageWindow(_("Review Partition Layout"), > _("Review and modify partitioning layout?"), > type = "yesno") >diff --git a/textw/partmethod_text.py b/textw/partmethod_text.py >index 85d07ef..30b370f 100644 >--- a/textw/partmethod_text.py >+++ b/textw/partmethod_text.py >@@ -38,8 +38,8 @@ class PartitionMethod: > > if rc == TEXT_BACK_CHECK: > return INSTALL_BACK >- elif rc == "ds": >- partitions.useAutopartitioning = 0 >+ elif rc == "ds": >+ partitions.useAutopartitioning = 0 > else: > partitions.useAutopartitioning = 1 > >diff --git a/textw/progress_text.py b/textw/progress_text.py >index 069107e..5a7029c 100644 >--- a/textw/progress_text.py >+++ b/textw/progress_text.py >@@ -46,13 +46,13 @@ def strip_markup(text): > > class InstallProgressWindow: > def __init__(self, screen): >- self.screen = screen >- self.drawn = False >+ self.screen = screen >+ self.drawn = False > > self.pct = 0 > > def __del__ (self): >- if self.drawn: >+ if self.drawn: > self.screen.popWindow () > > def _setupScreen(self): >@@ -120,12 +120,12 @@ class InstallProgressWindow: > class setupForInstall: > > def __call__(self, screen, anaconda): >- if anaconda.dir == DISPATCH_BACK: >- anaconda.id.setInstallProgressClass(None) >- return INSTALL_BACK >+ if anaconda.dir == DISPATCH_BACK: >+ anaconda.id.setInstallProgressClass(None) >+ return INSTALL_BACK > > anaconda.id.setInstallProgressClass(InstallProgressWindow(screen)) >- return INSTALL_OK >+ return INSTALL_OK > > if __name__ == "__main__": > screen = SnackScreen() >diff --git a/textw/task_text.py b/textw/task_text.py >index 470053d..7bb04b2 100644 >--- a/textw/task_text.py >+++ b/textw/task_text.py >@@ -48,16 +48,16 @@ class TaskWindow: > self.backend = anaconda.backend > tasks = anaconda.id.instClass.tasks > >- bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) >- >- toplevel = GridFormHelp (screen, _("Package selection"), >- "tasksel", 1, 5) >+ bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) >+ >+ toplevel = GridFormHelp (screen, _("Package selection"), >+ "tasksel", 1, 5) > > if anaconda.id.instClass.description: > labeltxt = anaconda.id.instClass.description > else: > labeltxt = _("The default installation of %s includes a set of software applicable for general internet usage. What additional tasks would you like your system to support?") %(productName,) >- toplevel.add (TextboxReflowed(55, labeltxt), 0, 0, (0, 0, 0, 1)) >+ toplevel.add (TextboxReflowed(55, labeltxt), 0, 0, (0, 0, 0, 1)) > > ct = CheckboxTree(height = 4, scroll = (len(tasks) > 4)) > for (txt, grps) in tasks: >@@ -70,21 +70,21 @@ class TaskWindow: > ct.append(_(txt), txt, False) > toplevel.add (ct, 0, 2, (0,0,0,1)) > >- custom = not anaconda.dispatch.stepInSkipList("group-selection") >- customize = Checkbox (_("Customize software selection"), custom) >- toplevel.add (customize, 0, 3, (0, 0, 0, 1)) >- toplevel.add (bb, 0, 4, (0, 0, 0, 0), growx = 1) >+ custom = not anaconda.dispatch.stepInSkipList("group-selection") >+ customize = Checkbox (_("Customize software selection"), custom) >+ toplevel.add (customize, 0, 3, (0, 0, 0, 1)) >+ toplevel.add (bb, 0, 4, (0, 0, 0, 0), growx = 1) > >- result = toplevel.run() >+ result = toplevel.run() > rc = bb.buttonPressed (result) >- if rc == TEXT_BACK_CHECK: >- screen.popWindow() >- return INSTALL_BACK >+ if rc == TEXT_BACK_CHECK: >+ screen.popWindow() >+ return INSTALL_BACK > >- if customize.selected(): >- anaconda.dispatch.skipStep("group-selection", skip = 0) >- else: >- anaconda.dispatch.skipStep("group-selection") >+ if customize.selected(): >+ anaconda.dispatch.skipStep("group-selection", skip = 0) >+ else: >+ anaconda.dispatch.skipStep("group-selection") > > sel = ct.getSelection() > for (txt, grps) in tasks: >@@ -92,7 +92,7 @@ class TaskWindow: > map(self.backend.selectGroup, grps) > else: > map(self.backend.deselectGroup, grps) >- screen.popWindow() >- >+ screen.popWindow() >+ > return INSTALL_OK > >diff --git a/textw/timezone_text.py b/textw/timezone_text.py >index f12ea78..2677fde 100644 >--- a/textw/timezone_text.py >+++ b/textw/timezone_text.py >@@ -43,36 +43,36 @@ class TimezoneWindow: > return zoneList > > def updateSysClock(self): >- args = ["--hctosys"] >- if self.c.selected(): >- args.append("--utc") >+ args = ["--hctosys"] >+ if self.c.selected(): >+ args.append("--utc") > >- iutil.execWithRedirect("hwclock", args, searchPath=1) >- self.g.setTimer(500) >- self.updateClock() >+ iutil.execWithRedirect("hwclock", args, searchPath=1) >+ self.g.setTimer(500) >+ self.updateClock() > > def updateClock(self): > # disable for now > return > >-# if os.access("/usr/share/zoneinfo/" + self.l.current(), os.R_OK): >-# os.environ['TZ'] = self.l.current() >-# self.label.setText(self.currentTime()) >-# else: >-# self.label.setText("") >+# if os.access("/usr/share/zoneinfo/" + self.l.current(), os.R_OK): >+# os.environ['TZ'] = self.l.current() >+# self.label.setText(self.currentTime()) >+# else: >+# self.label.setText("") > > def currentTime(self): >- return "Current time: " + strftime("%X %Z", localtime(time())) >+ return "Current time: " + strftime("%X %Z", localtime(time())) > > def __call__(self, screen, anaconda): >- timezones = self.getTimezoneList() >- (default, asUtc) = anaconda.id.timezone.getTimezoneInfo() >+ timezones = self.getTimezoneList() >+ (default, asUtc) = anaconda.id.timezone.getTimezoneInfo() > if not default: >- default = anaconda.id.instLanguage.getDefaultTimeZone() >+ default = anaconda.id.instLanguage.getDefaultTimeZone() > >- bb = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON]) >- t = TextboxReflowed(30, >- _("In which time zone are you located?")) >+ bb = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON]) >+ t = TextboxReflowed(30, >+ _("In which time zone are you located?")) > > if not anaconda.isKickstart and not hasWindows(anaconda.id.bootloader): > asUtc = True >@@ -80,38 +80,38 @@ class TimezoneWindow: > # > # disabling this for now > # >-# self.label = Label(self.currentTime()) >- >- self.l = Listbox(5, scroll = 1, returnExit = 0) >+# self.label = Label(self.currentTime()) >+ >+ self.l = Listbox(5, scroll = 1, returnExit = 0) > > for tz in timezones: >- self.l.append(gettext.ldgettext("system-config-date", tz), tz) >+ self.l.append(gettext.ldgettext("system-config-date", tz), tz) > >- self.l.setCurrent(default.replace("_", " ")) >-# self.l.setCallback(self.updateClock) >+ self.l.setCurrent(default.replace("_", " ")) >+# self.l.setCallback(self.updateClock) > >- self.c = Checkbox(_("System clock uses UTC"), isOn = asUtc) >-# self.c.setCallback(self.updateSysClock) >+ self.c = Checkbox(_("System clock uses UTC"), isOn = asUtc) >+# self.c.setCallback(self.updateSysClock) > >- self.g = GridFormHelp(screen, _("Time Zone Selection"), "timezone", >- 1, 5) >- self.g.add(t, 0, 0) >-# self.g.add(self.label, 0, 1, padding = (0, 1, 0, 0), anchorLeft = 1) >- self.g.add(self.c, 0, 2, padding = (0, 1, 0, 1), anchorLeft = 1) >- self.g.add(self.l, 0, 3, padding = (0, 0, 0, 1)) >- self.g.add(bb, 0, 4, growx = 1) >+ self.g = GridFormHelp(screen, _("Time Zone Selection"), "timezone", >+ 1, 5) >+ self.g.add(t, 0, 0) >+# self.g.add(self.label, 0, 1, padding = (0, 1, 0, 0), anchorLeft = 1) >+ self.g.add(self.c, 0, 2, padding = (0, 1, 0, 1), anchorLeft = 1) >+ self.g.add(self.l, 0, 3, padding = (0, 0, 0, 1)) >+ self.g.add(bb, 0, 4, growx = 1) > > # disabling for now >-# self.updateClock() >-# self.updateSysClock() >+# self.updateClock() >+# self.updateSysClock() > # >-# self.g.setTimer(500) >+# self.g.setTimer(500) > # >-# result = "TIMER" >-# while result == "TIMER": >-# result = self.g.run() >-# if result == "TIMER": >-# self.updateClock() >+# result = "TIMER" >+# while result == "TIMER": >+# result = self.g.run() >+# if result == "TIMER": >+# self.updateClock() > > result = "" > while 1: >@@ -125,8 +125,8 @@ class TimezoneWindow: > break > > screen.popWindow() >- anaconda.id.timezone.setTimezoneInfo(self.l.current().replace(" ", "_"), asUtc = self.c.selected()) >+ anaconda.id.timezone.setTimezoneInfo(self.l.current().replace(" ", "_"), asUtc = self.c.selected()) > >- return INSTALL_OK >+ return INSTALL_OK > > >diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py >index df79148..0fb8579 100644 >--- a/textw/upgrade_text.py >+++ b/textw/upgrade_text.py >@@ -34,9 +34,9 @@ class UpgradeMigrateFSWindow: > > migent = anaconda.id.fsset.getMigratableEntries() > >- g = GridFormHelp(screen, _("Migrate File Systems"), "upmigfs", 1, 4) >+ g = GridFormHelp(screen, _("Migrate File Systems"), "upmigfs", 1, 4) > >- text = (_("This release of %s supports " >+ text = (_("This release of %s supports " > "the an updated file system, which has several " > "benefits over the file system traditionally shipped " > "in %s. This installation program can migrate " >@@ -44,8 +44,8 @@ class UpgradeMigrateFSWindow: > "Which of these partitions would you like to migrate?") % > (productName, productName)) > >- tb = TextboxReflowed(60, text) >- g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1)) >+ tb = TextboxReflowed(60, text) >+ g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1)) > > partlist = CheckboxTree(height=4, scroll=1) > for entry in migent: >@@ -58,20 +58,20 @@ class UpgradeMigrateFSWindow: > entry.origfsystem.getName(), > entry.mountpoint), entry, migrating) > >- g.add(partlist, 0, 1, padding = (0, 0, 0, 1)) >+ g.add(partlist, 0, 1, padding = (0, 0, 0, 1)) > >- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] ) >- g.add(buttons, 0, 3, anchorLeft = 1, growx = 1) >+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] ) >+ g.add(buttons, 0, 3, anchorLeft = 1, growx = 1) > >- while 1: >- result = g.run() >+ while 1: >+ result = g.run() > >- if (buttons.buttonPressed(result)): >- result = buttons.buttonPressed(result) >+ if (buttons.buttonPressed(result)): >+ result = buttons.buttonPressed(result) > >- if result == TEXT_BACK_CHECK: >- screen.popWindow() >- return INSTALL_BACK >+ if result == TEXT_BACK_CHECK: >+ screen.popWindow() >+ return INSTALL_BACK > > # reset > for entry in migent: >@@ -96,89 +96,89 @@ class UpgradeMigrateFSWindow: > > class UpgradeSwapWindow: > def __call__ (self, screen, anaconda): >- (fsList, suggSize, suggMntPoint) = anaconda.id.upgradeSwapInfo >+ (fsList, suggSize, suggMntPoint) = anaconda.id.upgradeSwapInfo > > ramDetected = iutil.memInstalled()/1024 > >- text = _("Recent kernels (2.4 or newer) need significantly more swap than older " >- "kernels, up to twice the amount of RAM on the " >- "system. You currently have %dMB of swap configured, but " >- "you may create additional swap space on one of your " >- "file systems now.") % (iutil.swapAmount() / 1024) >- >- tb = TextboxReflowed(60, text) >- amount = Entry(10, scroll = 0) >- amount.set(str(suggSize)) >- >- l = len(fsList) >- scroll = 0 >- if l > 4: >- l = 4 >- scroll = 1 >- listbox = Listbox(l, scroll = scroll) >- >- liLabel = Label("%-25s %-15s %8s" % (_("Mount Point"), >- _("Partition"), _("Free Space"))) >- >- count = 0 >- for (mnt, part, size) in fsList: >- listbox.append("%-25s /dev/%-10s %6dMB" % (mnt, part, size), count) >- >- if (mnt == suggMntPoint): >- listbox.setCurrent(count) >- >- count = count + 1 >- >- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Skip"), "skip"), >- TEXT_BACK_BUTTON] ) >- >- amGrid = Grid(2, 3) >- amGrid.setField(Label(_("RAM detected (MB):")), 0, 0, anchorLeft = 1, >- padding = (0, 0, 1, 0)) >- amGrid.setField(Label(str(ramDetected)), 1, 0, anchorLeft = 1) >- amGrid.setField(Label(_("Suggested size (MB):")), 0, 1, anchorLeft = 1, >- padding = (0, 0, 1, 0)) >- amGrid.setField(Label(str(suggSize)), 1, 1, anchorLeft = 1) >- amGrid.setField(Label(_("Swap file size (MB):")), 0, 2, anchorLeft = 1, >- padding = (0, 0, 1, 0)) >- amGrid.setField(amount, 1, 2) >- >- liGrid = Grid(1, 2) >- liGrid.setField(liLabel, 0, 0) >- liGrid.setField(listbox, 0, 1) >- >- g = GridFormHelp(screen, _("Add Swap"), "upgradeswap", 1, 4) >- g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1)) >- g.add(amGrid, 0, 1, padding = (0, 0, 0, 1)) >- g.add(liGrid, 0, 2, padding = (0, 0, 0, 1)) >- g.add(buttons, 0, 3, anchorLeft = 1, growx = 1) >- >- while 1: >- result = g.run() >- >- if (buttons.buttonPressed(result)): >- result = buttons.buttonPressed(result) >- >- if result == TEXT_BACK_CHECK: >- screen.popWindow() >- return INSTALL_BACK >- elif result == "skip": >- screen.popWindow() >- return INSTALL_OK >- >- val = amount.value() >+ text = _("Recent kernels (2.4 or newer) need significantly more swap than older " >+ "kernels, up to twice the amount of RAM on the " >+ "system. You currently have %dMB of swap configured, but " >+ "you may create additional swap space on one of your " >+ "file systems now.") % (iutil.swapAmount() / 1024) >+ >+ tb = TextboxReflowed(60, text) >+ amount = Entry(10, scroll = 0) >+ amount.set(str(suggSize)) >+ >+ l = len(fsList) >+ scroll = 0 >+ if l > 4: >+ l = 4 >+ scroll = 1 >+ listbox = Listbox(l, scroll = scroll) >+ >+ liLabel = Label("%-25s %-15s %8s" % (_("Mount Point"), >+ _("Partition"), _("Free Space"))) >+ >+ count = 0 >+ for (mnt, part, size) in fsList: >+ listbox.append("%-25s /dev/%-10s %6dMB" % (mnt, part, size), count) >+ >+ if (mnt == suggMntPoint): >+ listbox.setCurrent(count) >+ >+ count = count + 1 >+ >+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Skip"), "skip"), >+ TEXT_BACK_BUTTON] ) >+ >+ amGrid = Grid(2, 3) >+ amGrid.setField(Label(_("RAM detected (MB):")), 0, 0, anchorLeft = 1, >+ padding = (0, 0, 1, 0)) >+ amGrid.setField(Label(str(ramDetected)), 1, 0, anchorLeft = 1) >+ amGrid.setField(Label(_("Suggested size (MB):")), 0, 1, anchorLeft = 1, >+ padding = (0, 0, 1, 0)) >+ amGrid.setField(Label(str(suggSize)), 1, 1, anchorLeft = 1) >+ amGrid.setField(Label(_("Swap file size (MB):")), 0, 2, anchorLeft = 1, >+ padding = (0, 0, 1, 0)) >+ amGrid.setField(amount, 1, 2) >+ >+ liGrid = Grid(1, 2) >+ liGrid.setField(liLabel, 0, 0) >+ liGrid.setField(listbox, 0, 1) >+ >+ g = GridFormHelp(screen, _("Add Swap"), "upgradeswap", 1, 4) >+ g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1)) >+ g.add(amGrid, 0, 1, padding = (0, 0, 0, 1)) >+ g.add(liGrid, 0, 2, padding = (0, 0, 0, 1)) >+ g.add(buttons, 0, 3, anchorLeft = 1, growx = 1) >+ >+ while 1: >+ result = g.run() >+ >+ if (buttons.buttonPressed(result)): >+ result = buttons.buttonPressed(result) >+ >+ if result == TEXT_BACK_CHECK: >+ screen.popWindow() >+ return INSTALL_BACK >+ elif result == "skip": >+ screen.popWindow() >+ return INSTALL_OK >+ >+ val = amount.value() > >- try: >- val = int(val) >- except ValueError: >- anaconda.intf.messageWindow(_("Error"), >+ try: >+ val = int(val) >+ except ValueError: >+ anaconda.intf.messageWindow(_("Error"), > _("The value you entered is not a " > "valid number.")) > >- if type(val) == type(1): >- (mnt, part, size) = fsList[listbox.current()] >- if size < (val + 16): >- anaconda.intf.messageWindow(_("Error"), >+ if type(val) == type(1): >+ (mnt, part, size) = fsList[listbox.current()] >+ if size < (val + 16): >+ anaconda.intf.messageWindow(_("Error"), > _("There is not enough space on the " > "device you selected for the swap " > "partition.")) >@@ -186,15 +186,15 @@ class UpgradeSwapWindow: > anaconda.intf.messageWindow(_("Warning"), > _("The swap file must be between 1 " > "and 2000 MB in size.")) >- else: >- screen.popWindow() >+ else: >+ screen.popWindow() > if flags.setupFilesystems: > upgrade.createSwapFile(anaconda.rootPath, anaconda.id.fsset, mnt, val) > anaconda.dispatch.skipStep("addswap", 1) >- return INSTALL_OK >+ return INSTALL_OK > >- raise ValueError >- >+ raise ValueError >+ > class UpgradeExamineWindow: > def __call__ (self, screen, anaconda): > parts = anaconda.id.rootParts >@@ -207,23 +207,23 @@ class UpgradeExamineWindow: > partList = [] > partList.append(_("Reinstall System")) > >- if (anaconda.id.upgrade == None and anaconda.dispatch.stepInSkipList("installtype")) or anaconda.id.upgrade: >+ if (anaconda.id.upgrade == None and anaconda.dispatch.stepInSkipList("installtype")) or anaconda.id.upgrade: > default = 1 > else: > default = 0 > > for (drive, fs, desc, label) in parts: >- if drive[:5] != "/dev/": >- devname = "/dev/" + drive >- else: >- devname = drive >+ if drive[:5] != "/dev/": >+ devname = "/dev/" + drive >+ else: >+ devname = drive > partList.append("%s (%s)" %(desc, drive)) > > (button, choice) = ListboxChoiceWindow(screen, _("System to Upgrade"), > _("There seem to be one or more existing Linux installations " > "on your system.\n\nPlease choose one to upgrade, " >- "or select 'Reinstall System' to freshly install " >- "your system."), partList, >+ "or select 'Reinstall System' to freshly install " >+ "your system."), partList, > [ TEXT_OK_BUTTON, > TEXT_BACK_BUTTON ], > width = 55, scroll = scroll, >diff --git a/textw/welcome_text.py b/textw/welcome_text.py >index c5fce5c..144468c 100644 >--- a/textw/welcome_text.py >+++ b/textw/welcome_text.py >@@ -29,6 +29,6 @@ class WelcomeWindow: > _("Welcome to %s!\n\n") > % (productName, ), > buttons = [TEXT_OK_BUTTON], width = 50, >- help = "welcome") >+ help = "welcome") > > return INSTALL_OK >diff --git a/timezone.py b/timezone.py >index bb599bb..4f1ecb3 100644 >--- a/timezone.py >+++ b/timezone.py >@@ -32,17 +32,17 @@ def bool(val): > class Timezone: > > def writeKS(self, f): >- f.write("timezone") >- if self.utc: >- f.write(" --utc") >- f.write(" %s\n" % self.tz) >+ f.write("timezone") >+ if self.utc: >+ f.write(" --utc") >+ f.write(" %s\n" % self.tz) > > def write(self, instPath): >- # dont do this in test mode! >- if flags.test: >- return >- >- fromFile = instPath + "/usr/share/zoneinfo/" + self.tz >+ # dont do this in test mode! >+ if flags.test: >+ return >+ >+ fromFile = instPath + "/usr/share/zoneinfo/" + self.tz > > if not os.access(fromFile, os.R_OK): > log.error("Timezone to be copied (%s) doesn't exist" % fromFile) >@@ -52,34 +52,34 @@ class Timezone: > except OSError, (errno, msg): > log.error("Error copying timezone (from %s): %s" % (fromFile, msg)) > >- f = open(instPath + "/etc/sysconfig/clock", "w") >+ f = open(instPath + "/etc/sysconfig/clock", "w") > >- f.write('ZONE="%s"\n' % self.tz) >- f.close() >+ f.write('ZONE="%s"\n' % self.tz) >+ f.close() > >- try: >- f = open(instPath + "/etc/adjtime", "r") >- lines = f.readlines() >- f.close() >- except: >- lines = [ "0.0 0 0.0\n", "0\n" ] >+ try: >+ f = open(instPath + "/etc/adjtime", "r") >+ lines = f.readlines() >+ f.close() >+ except: >+ lines = [ "0.0 0 0.0\n", "0\n" ] > >- f = open(instPath + "/etc/adjtime", "w") >- f.write(lines[0]) >- f.write(lines[1]) >- if self.utc: >- f.write("UTC\n") >- else: >- f.write("LOCAL\n") >- f.close() >+ f = open(instPath + "/etc/adjtime", "w") >+ f.write(lines[0]) >+ f.write(lines[1]) >+ if self.utc: >+ f.write("UTC\n") >+ else: >+ f.write("LOCAL\n") >+ f.close() > > def getTimezoneInfo(self): >- return (self.tz, self.utc) >+ return (self.tz, self.utc) > > def setTimezoneInfo(self, timezone, asUtc = 0): >- self.tz = timezone >- self.utc = asUtc >+ self.tz = timezone >+ self.utc = asUtc > > def __init__(self): >- self.tz = "America/New_York" >- self.utc = 0 >+ self.tz = "America/New_York" >+ self.utc = 0 >diff --git a/upgrade.py b/upgrade.py >index 5620e2a..c45940b 100644 >--- a/upgrade.py >+++ b/upgrade.py >@@ -171,7 +171,7 @@ def getDirtyDevString(dirtyDevs): > return ret > > def mountRootPartition(anaconda, rootInfo, oldfsset, allowDirty = 0, >- warnDirty = 0, readOnly = 0): >+ warnDirty = 0, readOnly = 0): > (root, rootFs) = rootInfo > bindMount = 0 > >@@ -260,7 +260,7 @@ def upgradeSwapSuggestion(anaconda): > mem = iutil.memInstalled() > rem = mem % 16384 > if rem: >- mem = mem + (16384 - rem) >+ mem = mem + (16384 - rem) > mem = mem / 1024 > > anaconda.dispatch.skipStep("addswap", 0) >@@ -276,12 +276,12 @@ def upgradeSwapSuggestion(anaconda): > # total, we're safe > if (swap >= (mem * 1.5)) and (swap + mem >= 192): > anaconda.dispatch.skipStep("addswap", 1) >- return >+ return > > # if our total is 512 megs or more, we should be safe > if (swap + mem >= 512): > anaconda.dispatch.skipStep("addswap", 1) >- return >+ return > > fsList = [] > >@@ -302,17 +302,17 @@ def upgradeSwapSuggestion(anaconda): > suggSize = 0 > suggMnt = None > for (mnt, part, size) in fsList: >- if (size > suggSize) and (size > (suggestion + 100)): >- suggMnt = mnt >+ if (size > suggSize) and (size > (suggestion + 100)): >+ suggMnt = mnt > > anaconda.id.upgradeSwapInfo = (fsList, suggestion, suggMnt) > > def swapfileExists(swapname): > try: > os.lstat(swapname) >- return 1 >+ return 1 > except: >- return 0 >+ return 0 > > def createSwapFile(instPath, theFsset, mntPoint, size): > fstabPath = instPath + "/etc/fstab" >@@ -330,9 +330,9 @@ def createSwapFile(instPath, theFsset, mntPoint, size): > > count = 0 > while (swapfileExists(instPath + file) or >- swapFileDict.has_key(file)): >- count = count + 1 >- tmpFile = "/SWAP-%d" % (count) >+ swapFileDict.has_key(file)): >+ count = count + 1 >+ tmpFile = "/SWAP-%d" % (count) > if mntPoint != "/": > file = mntPoint + tmpFile > else: >@@ -358,42 +358,42 @@ def upgradeMountFilesystems(anaconda): > # mount everything and turn on swap > > if flags.setupFilesystems: >- try: >- mountRootPartition(anaconda, anaconda.id.upgradeRoot[0], anaconda.id.fsset, >+ try: >+ mountRootPartition(anaconda, anaconda.id.upgradeRoot[0], anaconda.id.fsset, > allowDirty = 0) > except SystemError: >- anaconda.intf.messageWindow(_("Mount failed"), >- _("One or more of the file systems listed in the " >- "/etc/fstab on your Linux system cannot be mounted. " >- "Please fix this problem and try to upgrade again.")) >- sys.exit(0) >+ anaconda.intf.messageWindow(_("Mount failed"), >+ _("One or more of the file systems listed in the " >+ "/etc/fstab on your Linux system cannot be mounted. " >+ "Please fix this problem and try to upgrade again.")) >+ sys.exit(0) > except RuntimeError: > anaconda.intf.messageWindow(_("Mount failed"), >- _("One or more of the file systems listed in the " >+ _("One or more of the file systems listed in the " > "/etc/fstab of your Linux system are inconsistent and " > "cannot be mounted. Please fix this problem and try to " > "upgrade again.")) > sys.exit(0) > >- checkLinks = ( '/etc', '/var', '/var/lib', '/var/lib/rpm', >- '/boot', '/tmp', '/var/tmp', '/root', >+ checkLinks = ( '/etc', '/var', '/var/lib', '/var/lib/rpm', >+ '/boot', '/tmp', '/var/tmp', '/root', > '/bin/sh', '/usr/tmp') >- badLinks = [] >- for n in checkLinks: >- if not os.path.islink(anaconda.rootPath + n): continue >- l = os.readlink(anaconda.rootPath + n) >- if l[0] == '/': >- badLinks.append(n) >- >- if badLinks: >- message = _("The following files are absolute symbolic " >- "links, which we do not support during an " >- "upgrade. Please change them to relative " >- "symbolic links and restart the upgrade.\n\n") >- for n in badLinks: >- message = message + '\t' + n + '\n' >- anaconda.intf.messageWindow(_("Absolute Symlinks"), message) >- sys.exit(0) >+ badLinks = [] >+ for n in checkLinks: >+ if not os.path.islink(anaconda.rootPath + n): continue >+ l = os.readlink(anaconda.rootPath + n) >+ if l[0] == '/': >+ badLinks.append(n) >+ >+ if badLinks: >+ message = _("The following files are absolute symbolic " >+ "links, which we do not support during an " >+ "upgrade. Please change them to relative " >+ "symbolic links and restart the upgrade.\n\n") >+ for n in badLinks: >+ message = message + '\t' + n + '\n' >+ anaconda.intf.messageWindow(_("Absolute Symlinks"), message) >+ sys.exit(0) > > # fix for 80446 > badLinks = [] >@@ -403,14 +403,14 @@ def upgradeMountFilesystems(anaconda): > badLinks.append(n) > > if badLinks: >- message = _("The following are directories which should instead " >+ message = _("The following are directories which should instead " > "be symbolic links, which will cause problems with the " > "upgrade. Please return them to their original state " > "as symbolic links and restart the upgrade.\n\n") > for n in badLinks: > message = message + '\t' + n + '\n' >- anaconda.intf.messageWindow(_("Invalid Directories"), message) >- sys.exit(0) >+ anaconda.intf.messageWindow(_("Invalid Directories"), message) >+ sys.exit(0) > > bindMountDevDirectory(anaconda.rootPath) > else: >@@ -421,7 +421,7 @@ def upgradeMountFilesystems(anaconda): > type="ok") > return DISPATCH_BACK > >- newfsset = readFstab(anaconda) >+ newfsset = readFstab(anaconda) > for entry in newfsset.entries: > anaconda.id.fsset.add(entry) > if flags.setupFilesystems: >diff --git a/vnc.py b/vnc.py >index 08ed4ec..0d11f76 100644 >--- a/vnc.py >+++ b/vnc.py >@@ -367,7 +367,7 @@ def askVncWindow(title = None, message = None): > buttons = [ _("Use text mode"), > _("Start VNC") ]) > >- if button == string.lower (_("Use text mode")): >+ if button == string.lower (_("Use text mode")): > screen.finish() > return -1 > else:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 461357
: 315951