diff options
-rw-r--r-- | autopart.py | 88 | ||||
-rw-r--r-- | cmdline.py | 32 | ||||
-rw-r--r-- | exception.py | 4 | ||||
-rwxr-xr-x | gui.py | 10 | ||||
-rwxr-xr-x | isys/isys.py | 2 | ||||
-rw-r--r-- | iw/GroupSelector.py | 2 | ||||
-rw-r--r-- | iw/datacombo.py | 2 | ||||
-rw-r--r-- | iw/pixmapRadioButtonGroup_gui.py | 2 | ||||
-rw-r--r-- | partRequests.py | 2 | ||||
-rw-r--r-- | partedUtils.py | 4 | ||||
-rw-r--r-- | rescue.py | 6 | ||||
-rw-r--r-- | scripts/getlangnames.py | 2 | ||||
-rwxr-xr-x | scripts/makestamp.py | 14 | ||||
-rw-r--r-- | scripts/maketreeinfo.py | 20 | ||||
-rw-r--r-- | text.py | 4 | ||||
-rw-r--r-- | textw/partition_text.py | 2 | ||||
-rw-r--r-- | textw/progress_text.py | 2 |
17 files changed, 99 insertions, 99 deletions
diff --git a/autopart.py b/autopart.py index 490ec1f64..f4870b0a2 100644 --- a/autopart.py +++ b/autopart.py @@ -132,19 +132,19 @@ def printNewRequestsCyl(diskset, newRequest): continue part = partedUtils.get_partition_by_name(diskset.disks, req.device) -## print req -## print "Start Cyl:%s End Cyl: %s" % (partedUtils.start_sector_to_cyl(part.geom.dev, part.geom.start), -## partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end)) +## print(req) +## print("Start Cyl:%s End Cyl: %s" % (partedUtils.start_sector_to_cyl(part.geom.dev, part.geom.start), +## partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end))) def printFreespaceitem(part): return partedUtils.get_partition_name(part), part.geom.start, part.geom.end, partedUtils.getPartSizeMB(part) def printFreespace(free): - print "Free Space Summary:" + print("Free Space Summary:") for drive in free.keys(): - print "On drive ",drive + print("On drive ", drive) for part in free[drive]: - print "Freespace:", printFreespaceitem(part) + print("Freespace:", printFreespaceitem(part)) def findFreespace(diskset): @@ -341,7 +341,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): for num in number: for request in todo[num]: -# print "\nInserting ->",request +# print("\nInserting ->", request) if requests.isBootable(request): isBoot = 1 else: @@ -356,7 +356,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): # drives. this keeps us on the first possible drive if isBoot and largestPart[1]: break -## print "Trying drive", drive +## print("Trying drive", drive) disk = diskset.disks[drive] numPrimary = len(partedUtils.get_primary_partitions(disk)) numLogical = len(partedUtils.get_logical_partitions(disk)) @@ -636,11 +636,11 @@ def growParts(diskset, requests, newParts): #### newRequest = requests.copy() -## print "new requests" +## print("new requests") ## printNewRequestsCyl(diskset, requests) -## print "orig requests" +## print("orig requests") ## printNewRequestsCyl(diskset, newRequest) -## print "\n\n\n" +## print("\n\n\n") (free, freeSize, largestFree) = getFreeSpace(diskset) @@ -662,9 +662,9 @@ def growParts(diskset, requests, newParts): if not growable.keys(): return -## print "new requests before looping" +## print("new requests before looping") ## printNewRequestsCyl(diskset, requests) -## print "\n\n\n" +## print("\n\n\n") # loop over all drives, grow all growable partitions one at a time grownList = [] @@ -682,14 +682,14 @@ def growParts(diskset, requests, newParts): # if less than one sector left, we're done # if drive not in freeSize.keys() or freeSize[drive] == lastFreeSize: if drive not in freeSize.keys(): -# print "leaving outer loop because no more space on %s\n\n" % drive +# print("leaving outer loop because no more space on %s\n\n" % drive) break -## print "\nAt start:" -## print drive,freeSize.keys() -## print freeSize[drive], lastFreeSize -## print "\n" +## print("\nAt start:") +## print(drive,freeSize.keys()) +## print(freeSize[drive], lastFreeSize) +## print("\n") -## print diskset.diskState() +## print(diskset.diskState()) outer_iter = outer_iter + 1 @@ -729,11 +729,11 @@ def growParts(diskset, requests, newParts): if drive not in freeSize.keys(): donegrowing = 1 -# print "leaving inner loop because no more space on %s\n\n" % drive +# print("leaving inner loop because no more space on %s\n\n" % drive) break -## print "\nprocessing ID",request.uniqueID, request.mountpoint -## print "growSize, freeSize = ",growSize[drive], freeSize[drive] +## print("\nprocessing ID",request.uniqueID, request.mountpoint) +## print("growSize, freeSize = ",growSize[drive], freeSize[drive]) donegrowing = 0 @@ -749,9 +749,9 @@ def growParts(diskset, requests, newParts): growby = cylsectors; maxsect = startSize + growby -## print request -## print "percent, growby, maxsect, free", percent, growby, maxsect,freeSize[drive], startSize, lastFreeSize -## print "max is ",maxsect +## print(request) +## print("percent, growby, maxsect, free", percent, growby, maxsect,freeSize[drive], startSize, lastFreeSize) +## print("max is ", maxsect) imposedMax = 0 if request.maxSizeMB: @@ -795,9 +795,9 @@ def growParts(diskset, requests, newParts): maxsect = long(maxfree) + startSize imposedMax = 1 -# print "freesize, max, maxfree = ",freeSize[drive],maxsect, maxfree -# print "freeSizeMB, maxMB = ", freeSize[drive] * sector_size/(1024.0 * 1024.0), maxsect * sector_size/(1024.0*1024.0), largestFree[drive] * sector_size/(1024.0*1024.0) -# print "startsize = ",startSize +# print("freesize, max, maxfree = ",freeSize[drive],maxsect, maxfree) +# print("freeSizeMB, maxMB = ", freeSize[drive] * sector_size/(1024.0 * 1024.0), maxsect * sector_size/(1024.0*1024.0), largestFree[drive] * sector_size/(1024.0*1024.0)) +# print("startsize = ", startSize) min = startSize max = maxsect @@ -806,14 +806,14 @@ def growParts(diskset, requests, newParts): lastDiff = 0 # binary search -## print "start min, max, cur, diffs = ",min,max,cur,diff,lastDiff +## print("start min, max, cur, diffs = ",min,max,cur,diff,lastDiff) inner_iter = 0 ret = PARTITION_SUCCESS # request succeeded with initial size while (max != min) and (lastDiff != diff) and (inner_iter < 2000): ## printNewRequestsCyl(diskset, newRequest) # 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 @@ -823,44 +823,44 @@ def growParts(diskset, requests, newParts): except PartitioningError, msg: ret = PARTITION_FAIL max = cur -## print "!!!!!!!!!!! processPartitioning failed - %s" % msg +## print("!!!!!!!!!!! processPartitioning failed - %s" % msg) lastDiff = diff diff = max - min -# print min, max, diff, cylsectors -# print diskset.diskState() +# print(min, max, diff, cylsectors) +# print(diskset.diskState()) cur = max - (diff / 2) inner_iter = inner_iter + 1 -# print "sizes at end of loop - cur: %s min:%s max:%s diff:%s lastDiff:%s" % (cur,min,max,diff,lastDiff) +# print("sizes at end of loop - cur: %s min:%s max:%s diff:%s lastDiff:%s" % (cur,min,max,diff,lastDiff)) # freeSize[drive] = freeSize[drive] - (min - startSize) -# print "shrinking freeSize to ",freeSize[drive], lastFreeSize +# print("shrinking freeSize to ",freeSize[drive], lastFreeSize) # if freeSize[drive] < 0: -# print "freesize < 0!" +# print("freesize < 0!") # freeSize[drive] = 0 # we could have failed on the last try, in which case we # should go back to the smaller size if ret == PARTITION_FAIL: -# print "growing finally failed at size", min +# print("growing finally failed at size", min) request.requestSize = min*sector_size/1024.0/1024.0 processPartitioning(diskset, newRequest, newParts) -# print "end min, max, cur, diffs = ",min,max,cur,diff,lastDiff -# print "%s took %s loops" % (request.mountpoint, inner_iter) +# print("end min, max, cur, diffs = ",min,max,cur,diff,lastDiff) +# print("%s took %s loops" % (request.mountpoint, inner_iter)) lastFreeSize = freeSize[drive] (free, freeSize, largestFree) = getFreeSpace(diskset) -# printFreespace(free) +# print(Freespace(free)) if ret == PARTITION_FAIL or (max == maxsect and imposedMax): -# print "putting ",request.uniqueID,request.mountpoint," in grownList" +# print("putting ",request.uniqueID,request.mountpoint," in grownList") grownList.append(request.uniqueID) growSize[drive] = growSize[drive] - origSize[request.uniqueID] if growSize[drive] < 0: -# print "growsize < 0!" +# print("growsize < 0!") growSize[drive] = 0 def setPreexistParts(diskset, requests): @@ -1029,8 +1029,8 @@ def processPartitioning(diskset, requests, newParts): part = partedUtils.get_partition_by_name(diskset.disks, request.device) request.maxResizeSize = partedUtils.getMaxAvailPartSizeMB(part) -## print "disk layout after everything is done" -## print diskset.diskState() +## print("disk layout after everything is done") +## print(diskset.diskState()) def doPartitioning(diskset, requests, doRefresh = 1): for request in requests.requests: diff --git a/cmdline.py b/cmdline.py index 0aa980285..c17b355d1 100644 --- a/cmdline.py +++ b/cmdline.py @@ -40,26 +40,26 @@ class WaitWindow: def refresh(self): pass def __init__(self, title, text): - print text + print(text) class ProgressWindow: def pop(self): - print "" + print("") def pulse(self): pass def set(self, amount): if amount == self.total: - print _("Completed"), + print(_("Completed")) def refresh(self): pass def __init__(self, title, text, total, updpct = 0.05, pulse = False): self.total = total - print text - print _("In progress... "), + print(text) + print(_("In progress... ")) class InstallInterface: def __init__(self): @@ -84,7 +84,7 @@ class InstallInterface: def kickstartErrorWindow(self, text): s = _("The following error was found while parsing your " "kickstart configuration:\n\n%s") %(text,) - print s + print(s) while 1: time.sleep(5) @@ -92,19 +92,19 @@ class InstallInterface: def messageWindow(self, title, text, type="ok", default = None, custom_icon = None, custom_buttons = []): if type == "ok": - print text + print(text) else: - print _("Can't have a question in command line mode!") - print title - print text - print type, custom_buttons + print(_("an't have a question in command line mode!")) + print(title) + print(text) + print(type, custom_buttons) # don't exit while 1: time.sleep(5) def exceptionWindow(self, shortText, longTextFile): - print shortText + print(shortText) def partedExceptionWindow(self, exc): # if our only option is to cancel, let us handle the exception @@ -113,8 +113,8 @@ class InstallInterface: if exc.options == parted.EXCEPTION_CANCEL: return parted.EXCEPTION_UNHANDLED - print _("Parted exceptions can't be handled in command line mode!") - print exc.message + print(_("Parted exceptions can't be handled in command line mode!")) + print(exc.message) # don't exit while 1: @@ -139,7 +139,7 @@ class InstallInterface: exec s nextWin(instance) else: - print "In interactive step %s, can't continue" %(step,) + print("In interactive step %s, can't continue" %(step,)) while 1: time.sleep(1) @@ -168,7 +168,7 @@ class progressDisplay: def set_label(self, txt): if txt != self.display: self.display = txt - print self.display + print(self.display) def setupProgressDisplay(anaconda): if anaconda.dir == DISPATCH_BACK: diff --git a/exception.py b/exception.py index 3820c72f0..93dc36820 100644 --- a/exception.py +++ b/exception.py @@ -579,7 +579,7 @@ def handleException(anaconda, (type, value, tb)): os.kill(os.getpid(), signal.SIGKILL) elif rc == EXN_DEBUG: anaconda.intf.__del__ () - print text + print(text) pidfl = "/tmp/vncshell.pid" if os.path.exists(pidfl) and os.path.isfile(pidfl): @@ -604,7 +604,7 @@ def handleException(anaconda, (type, value, tb)): attr[3] = attr[3] & termios.ECHO termios.tcsetattr(si, termios.TCSADRAIN, attr) - print "\nEntering debugger..." + print("\nEntering debugger...") import pdb pdb.post_mortem (tb) os.kill(os.getpid(), signal.SIGKILL) @@ -219,9 +219,9 @@ def partedExceptionWindow(exc): if exc.options == parted.EXCEPTION_CANCEL: return parted.EXCEPTION_UNHANDLED log.critical("parted exception: %s: %s" %(exc.type_string,exc.message)) - print exc.type_string - print exc.message - print exc.options + print(exc.type_string) + print(exc.message) + print(exc.options) win = gtk.Dialog(exc.type_string, mainWindow, gtk.DIALOG_MODAL) addFrame(win) win.set_position(gtk.WIN_POS_CENTER) @@ -1410,7 +1410,7 @@ class InstallControlWindow: newScreenClass = loaded.__dict__[className] break except ImportError, e: - print e + print(e) win = MessageWindow(_("Error!"), _("An error occurred when attempting " "to load an installer interface " @@ -1513,7 +1513,7 @@ class InstallControlWindow: p = readImageFromFile("anaconda_header.png", dither = False, image = i) if p is None: - print _("Unable to load title bar") + print(_("Unable to load title bar")) if (gtk.gdk.screen_height() < 600) or \ (gtk.gdk.screen_height() <= 675 and not runningMiniWm()): i.hide() diff --git a/isys/isys.py b/isys/isys.py index 5f2a7f22c..88a6987f0 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -660,7 +660,7 @@ handleSegv = _isys.handleSegv biosdisks = {} for d in range(80, 80 + 15): disk = doGetBiosDisk("%d" %(d,)) - #print "biosdisk of %s is %s" %(d, disk) + #print("biosdisk of %s is %s" %(d, disk)) if disk is not None: biosdisks[disk] = d diff --git a/iw/GroupSelector.py b/iw/GroupSelector.py index fa3f03e60..23c27df86 100644 --- a/iw/GroupSelector.py +++ b/iw/GroupSelector.py @@ -65,7 +65,7 @@ def sanitizeString(s, translate = True): try: s = unicode(s, "utf-8") except UnicodeDecodeError, e: - print >> sys.stderr, "Unable to convert %s to a unicode object: %s" %(s, e) + print("Unable to convert %s to a unicode object: %s" % (s, e), file=sys.stderr) return "" return s diff --git a/iw/datacombo.py b/iw/datacombo.py index 08dfb95eb..6d85a775f 100644 --- a/iw/datacombo.py +++ b/iw/datacombo.py @@ -72,7 +72,7 @@ class DataComboBox(gtk.ComboBox): if __name__ == "__main__": def mycb(widget, *args): idx = widget.get_active() - print idx, widget.get_stored_data(idx), widget.get_text(idx) + print(idx, widget.get_stored_data(idx), widget.get_text(idx)) win = gtk.Window() diff --git a/iw/pixmapRadioButtonGroup_gui.py b/iw/pixmapRadioButtonGroup_gui.py index 89c4bb4e0..38323846b 100644 --- a/iw/pixmapRadioButtonGroup_gui.py +++ b/iw/pixmapRadioButtonGroup_gui.py @@ -186,7 +186,7 @@ if __name__ == "__main__": def nowquit(widget): global r - print "selection -> ",r.getCurrent() + print("selection -> %s" % (r.getCurrent(),)) gtk.mainquit() diff --git a/partRequests.py b/partRequests.py index b43f5037a..e5b0063c8 100644 --- a/partRequests.py +++ b/partRequests.py @@ -1037,7 +1037,7 @@ class LogicalVolumeRequestSpec(RequestSpec): def getMaximumResizeMB(self, partitions): vg = partitions.getRequestByID(self.volumeGroup) - print "max is", self.getActualSize(), vg.free, self.getActualSize() + vg.free + print("max is", self.getActualSize(), vg.free, self.getActualSize() + vg.free) return self.getActualSize() + vg.free def getMinimumResizeMB(self, partitions): diff --git a/partedUtils.py b/partedUtils.py index 86c1e456c..725ccc5b8 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -214,7 +214,7 @@ def set_partition_file_system_type(part, fstype): else: part.set_system(fstype.getPartedFileSystemType()) except: - print "Failed to set partition type to ",fstype.getName() + print("Failed to set partition type to ",fstype.getName()) pass def get_partition_drive(partition): @@ -1081,7 +1081,7 @@ class DiskSet: try: (pid, status) = os.waitpid(childpid, 0) except OSError, (num, msg): - print __name__, "waitpid:", msg + print(__name__, "waitpid:", msg) os.close(fd) @@ -191,14 +191,14 @@ def runShell(screen = None, msg=""): print if msg: print (msg) - print _("When finished please exit from the shell and your " - "system will reboot.") + print(_("When finished please exit from the shell and your " + "system will reboot.")) print if os.path.exists("/bin/sh"): iutil.execConsole() else: - print _("Unable to find /bin/sh to execute! Not starting shell") + print(_"Unable to find /bin/sh to execute! Not starting shell")) time.sleep(5) if screen: diff --git a/scripts/getlangnames.py b/scripts/getlangnames.py index 921c86802..3189ca835 100644 --- a/scripts/getlangnames.py +++ b/scripts/getlangnames.py @@ -35,4 +35,4 @@ nameList = names.keys() nameList.sort() for k in nameList: - print "%s\t%s" % (k, names[k]) + print("%s\t%s" % (k, names[k])) diff --git a/scripts/makestamp.py b/scripts/makestamp.py index c3f416c02..5edb86ba0 100755 --- a/scripts/makestamp.py +++ b/scripts/makestamp.py @@ -27,7 +27,7 @@ def usage(): args = "" for key in data: args = "%s [--%s=%s]" %(args, key, key) - print "%s: %s" % (sys.argv[0], args) + print("%s: %s" % (sys.argv[0], args)) sys.exit(1) data = {"timestamp": None, @@ -44,7 +44,7 @@ opts.append("allDiscs") (args, extra) = getopt.getopt(sys.argv[1:], '', opts) if len(extra) > 0: - print "had extra args: %s" % extra + print("had extra args: %s" % extra) usage() for (str, arg) in args: @@ -53,25 +53,25 @@ 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: - print >> sys.stderr, "timestamp not specified; using the current time" + print("timestamp not specified; using the current time", file=sys.stderr) data["timestamp"] = time.time() else: data["timestamp"] = float(data["timestamp"]) if data["releasestr"] is None: - print "What should be the release name associated with this disc?" + print("What should be the release name associated with this disc?") data["releasestr"] = sys.stdin.readline()[:-1] if data["arch"] is None: - print "What arch is this disc for?" + print("What arch is this disc for?") data["arch"] = sys.stdin.readline()[:-1] if data["discNum"] is None and allDiscs is None: - print >> sys.stderr, "No disc number specified; assuming disc 1" + print("No disc number specified; assuming disc 1", file=sys.stderr) data["discNum"] = "1" if data["outfile"] is None: diff --git a/scripts/maketreeinfo.py b/scripts/maketreeinfo.py index c53a672ea..573e76fbc 100644 --- a/scripts/maketreeinfo.py +++ b/scripts/maketreeinfo.py @@ -30,7 +30,7 @@ def usage(): args = "" for key in data: args = "%s [--%s=%s]" %(args, key, key) - print "%s: %s" % (sys.argv[0], args) + print("%s: %s" % (sys.argv[0], args)) sys.exit(1) # TODO: add composeid, images, etc. @@ -54,7 +54,7 @@ opts.append("allDiscs") (args, extra) = getopt.getopt(sys.argv[1:], '', opts) if len(extra) > 0: - print "had extra args: %s" % extra + print("had extra args: %s" % extra) usage() for (str, arg) in args: @@ -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 @@ -71,31 +71,31 @@ if type(data["timestamp"]) != float: data["timestamp"] = float(data["timestamp"]) if data["family"] is None: - print >> sys.stderr, "--family missing! This is probably bad!" + print("--family missing! This is probably bad!", file=sys.stderr) data["family"] = "" if data["variant"] is None: - print >> sys.stderr, "--variant missing, but that's OK." + print("--variant missing, but that's OK.", file=sys.stderr) data["variant"] = "" if data["version"] is None: - print >> sys.stderr, "--version missing! This is probably bad!" + print("--version missing! This is probably bad!", file=sys.stderr) data["version"] = "" if data["arch"] is None: - print >> sys.stderr, "--arch missing! This is probably bad!" + print("--arch missing! This is probably bad!", file=sys.stderr) data["arch"] = "" if data["discnum"] is None and allDiscs is None: - print >> sys.stderr, "--discnum missing; assuming disc 1" + print("--discnum missing; assuming disc 1", file=sys.stderr) data["discnum"] = "1" if data["totaldiscs"] is None and allDiscs is None: - print >> sys.stderr, "--totaldiscs missing; assuming 1" + print("--totaldiscs missing; assuming 1", file=sys.stderr) data["totaldiscs"] = "1" if data["packagedir"] is None: - print >> sys.stderr, "--packagedir missing. This might cause some weirdness." + print("--packagedir missing. This might cause some weirdness.", file=sys.stderr) data["packagedir"] = "" @@ -767,10 +767,10 @@ def debugSelf(screen): def spawnShell(screen): screen.suspend() - print "\n\nType <exit> to return to the install program.\n" + print("\n\nType <exit> to return to the install program.\n") if os.path.exists("/bin/sh"): iutil.execConsole() else: - print "Unable to find /bin/sh to execute! Not starting shell" + print("Unable to find /bin/sh to execute! Not starting shell") time.sleep(5) screen.resume() diff --git a/textw/partition_text.py b/textw/partition_text.py index 40831077b..b09213f02 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -141,7 +141,7 @@ class PartitionWindow: part = disk.next_partition() while part: if part.type & parted.PARTITION_METADATA: -# print "partition %s has type %d" %(get_partition_name(part), part.type) +# print("partition %s has type %d" %(get_partition_name(part), part.type)) part = disk.next_partition(part) continue # ignore the tiny < 1 MB partitions (#119479) diff --git a/textw/progress_text.py b/textw/progress_text.py index 069107e8d..af53a11a3 100644 --- a/textw/progress_text.py +++ b/textw/progress_text.py @@ -143,4 +143,4 @@ if __name__ == "__main__": p = ipw.get_fraction() screen.finish() - print p + print(p) |