diff options
author | Slávek Banko <[email protected]> | 2023-01-19 18:01:26 +0100 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-01-20 13:05:37 +0900 |
commit | 94f5a3f12e1c61aa2f3cde2d7b260c08489336ac (patch) | |
tree | 9062a30a1d81a1a97e9397548e4ec48ae63c18a4 /mountconfig/sizeview.py | |
parent | b9c0b6996a6da72f93baf50121a1be4a6fa48d2e (diff) | |
download | tde-guidance-94f5a3f12e1c61aa2f3cde2d7b260c08489336ac.tar.gz tde-guidance-94f5a3f12e1c61aa2f3cde2d7b260c08489336ac.zip |
Drop python2 support.
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'mountconfig/sizeview.py')
-rw-r--r-- | mountconfig/sizeview.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mountconfig/sizeview.py b/mountconfig/sizeview.py index a4169c4..49ce9f6 100644 --- a/mountconfig/sizeview.py +++ b/mountconfig/sizeview.py @@ -62,7 +62,7 @@ class SizeView(TQDialog): self.readSize() self.readSwaps() - partitions = self.partitions.keys() + partitions = list(self.partitions.keys()) partitions.sort() number=1 @@ -99,7 +99,7 @@ class SizeView(TQDialog): rows = int(n/cols)+1 else: rows = int(n/cols) - if n is 1: rows = 2 + if n == 1: rows = 2 # Build main Gridlayout. total_rows = rows+2 @@ -209,7 +209,7 @@ class DiskGroup(TQGroupBox): self.diskview.setScaledContents(1) DiskViewGroupLayout.addWidget(self.diskview) - parts = self.partitions.keys() + parts = list(self.partitions.keys()) parts.sort() self.percentages() @@ -247,11 +247,11 @@ class DiskGroup(TQGroupBox): def percentages(self): p_t = 0 - for p in self.partitions.values(): + for p in list(self.partitions.values()): p_t += int(p) self.perc = {} - for p in self.partitions.keys(): + for p in list(self.partitions.keys()): self.perc[p] = float(float(self.partitions[p])/float(p_t)) return self.perc @@ -408,7 +408,8 @@ class DiskPixmap(TQPixmap): linewidth = 2 # Width of surrounding frame - def __init__(self,percents,colors,(w,h)): + def __init__(self,percents,colors, xxx_todo_changeme): + (w,h) = xxx_todo_changeme self.percents = percents self.w,self.h = w,h self.colors = colors @@ -425,7 +426,7 @@ class DiskPixmap(TQPixmap): # Paint background, this is interesting for empty partitions. p.fillRect(0,0,w,h,TQBrush(TQColor("white"))) - parts = self.percents.keys() + parts = list(self.percents.keys()) parts.sort() xa = wa = 0 for part in parts: |