[virt-manager] [PATCH] virtinst: progress: Simplify if-statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Radostin Stoyanov <rstoyanov1@xxxxxxxxx>
---
 virtinst/progress.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/virtinst/progress.py b/virtinst/progress.py
index 29bff358..4284f854 100644
--- a/virtinst/progress.py
+++ b/virtinst/progress.py
@@ -253,10 +253,8 @@ class TextMeter(BaseMeter):
 
         # Include text + ui_rate in minimal
         tl = TerminalLine(8, 8+1+8)
-        if tl._llen > 80:
-            use_hours = True # For big screens, make it more readable.
-        else:
-            use_hours = False
+        # For big screens, make it more readable.
+        use_hours = bool(tl._llen > 80)
         ui_size = tl.add(' | %5sB' % fread)
         if self.size is None:
             ui_time = tl.add('  %s' % format_time(etime, use_hours))
@@ -301,10 +299,8 @@ class TextMeter(BaseMeter):
             text = self.basename
 
         tl = TerminalLine(8)
-        if tl._llen > 80:
-            use_hours = True # For big screens, make it more readable.
-        else:
-            use_hours = False
+        # For big screens, make it more readable.
+        use_hours = bool(tl._llen > 80)
         ui_size = tl.add(' | %5sB' % total_size)
         ui_time = tl.add('  %s' % format_time(self.re.elapsed_time(), use_hours))
         ui_end, not_done = _term_add_end(tl, self.size, amount_read)
-- 
2.14.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux