ba698f40db
9a9f9ecd-ignore-comments-in-keymap-conf-files.patch 9617d126-systray-Use-APPLICATION_STATUS-for-appindicator.patch e73abe5a-diskbackend-convert-to-long-the-calculated-size.patch 6e6f59e7-diskbackend-get-a-proper-size-of-existing-block-device-while-cloning.patch 23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch d1e1cf64-progress-remove-trailing-white-space.patch 63fce081-pycodestyle-Use-isinstance-for-type-checking.patch 08a58d61-pycodestyle-remove-description-of-fixed-errors.patch bc3c9a9d-progress-remove-unused-import.patch 2d276ebe-progress-dont-overwrite-format.patch e2ad4b2f-convert-iteritems-to-items.patch dff00d4f-remove-deprecated-statvfs-module.patch 75210ed3-replace-StringIO-with-io.patch a2bcd6c4-dont-compare-between-None-and-int.patch 44de92b7-use-reload-from-imp-module.patch 69c84bea-import-reduce-from-functools-module.patch 37ea5207-replace-StandardError-with-Exception.patch f41aafc7-Use-enumerate-instead-of-range-and-len.patch 91c0669c-cli-Fix-OrderedDict-mutated-during-iteration-on-python3.patch b8fa0c6b-xmlnsqemu-order-XML-output-like-libvirt-does.patch d2648d81-virtconv-dont-implicitly-depend-on-dict-hash-order.patch 999dbb36-cli-Make-VirtCLIArgument-instantiation-less-crazy.patch 7f1b4cee-pycodestyle-fix-all-E125-warnings.patch d82022bd-manager-drop-python2-only-cmp-usage.patch 374a3779-urlfetcher-write-test-file-as-binary-content.patch f7c8cf9f-devicepanic-dont-return-empty-model-list.patch 3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch 73de8285-systray-remove-redundant-variable-assignment.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=375
146 lines
5.1 KiB
Diff
146 lines
5.1 KiB
Diff
Subject: progress: Remove trailing white space
|
|
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:40 2017 +0100
|
|
Date: Fri Oct 20 11:49:12 2017 -0400:
|
|
Git: d1e1cf64a7c248f586308d8c89ea51855a9a0451
|
|
|
|
|
|
diff --git a/virtinst/progress.py b/virtinst/progress.py
|
|
index a27108b1..e9a243b1 100644
|
|
--- a/virtinst/progress.py
|
|
+++ b/virtinst/progress.py
|
|
@@ -9,9 +9,9 @@
|
|
# Lesser General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
-# License along with this library; if not, write to the
|
|
-# Free Software Foundation, Inc.,
|
|
-# 59 Temple Place, Suite 330,
|
|
+# License along with this library; if not, write to the
|
|
+# Free Software Foundation, Inc.,
|
|
+# 59 Temple Place, Suite 330,
|
|
# Boston, MA 02111-1307 USA
|
|
|
|
# This file is part of urlgrabber, a high-level cross-protocol url-grabber
|
|
@@ -113,7 +113,7 @@ class BaseMeter:
|
|
self.last_amount_read = 0
|
|
self.last_update_time = None
|
|
self.re = RateEstimator()
|
|
-
|
|
+
|
|
def start(self, filename=None, url=None, basename=None,
|
|
size=None, now=None, text=None):
|
|
self.filename = filename
|
|
@@ -131,7 +131,7 @@ class BaseMeter:
|
|
self.last_amount_read = 0
|
|
self.last_update_time = now
|
|
self._do_start(now)
|
|
-
|
|
+
|
|
def _do_start(self, now=None):
|
|
pass
|
|
|
|
@@ -158,7 +158,7 @@ class BaseMeter:
|
|
|
|
def _do_end(self, amount_read, now=None):
|
|
pass
|
|
-
|
|
+
|
|
# This is kind of a hack, but progress is gotten from grabber which doesn't
|
|
# know about the total size to download. So we do this so we can get the data
|
|
# out of band here. This will be "fixed" one way or anther soon.
|
|
@@ -173,7 +173,7 @@ def text_meter_total_size(size, downloaded=0):
|
|
#
|
|
# update: No size (minimal: 17 chars)
|
|
# -----------------------------------
|
|
-# <text> <rate> | <current size> <elapsed time>
|
|
+# <text> <rate> | <current size> <elapsed time>
|
|
# 8-48 1 8 3 6 1 9 5
|
|
#
|
|
# Order: 1. <text>+<current size> (17)
|
|
@@ -208,7 +208,7 @@ def text_meter_total_size(size, downloaded=0):
|
|
#
|
|
# end
|
|
# ---
|
|
-# <text> | <current size> <elapsed time>
|
|
+# <text> | <current size> <elapsed time>
|
|
# 8-56 3 6 1 9 5
|
|
#
|
|
# Order: 1. <text> ( 8)
|
|
@@ -341,7 +341,7 @@ class RateEstimator:
|
|
self.last_update_time = now
|
|
self.last_amount_read = 0
|
|
self.ave_rate = None
|
|
-
|
|
+
|
|
def update(self, amount_read, now=None):
|
|
if now is None: now = time.time()
|
|
# libcurl calls the progress callback when fetching headers
|
|
@@ -365,7 +365,7 @@ class RateEstimator:
|
|
time_diff, read_diff, self.ave_rate, self.timescale)
|
|
self.last_amount_read = amount_read
|
|
#print 'results', time_diff, read_diff, self.ave_rate
|
|
-
|
|
+
|
|
#####################################################################
|
|
# result methods
|
|
def average_rate(self):
|
|
@@ -401,14 +401,14 @@ class RateEstimator:
|
|
epsilon = time_diff / timescale
|
|
if epsilon > 1: epsilon = 1.0
|
|
return self._rolling_ave(time_diff, read_diff, last_ave, epsilon)
|
|
-
|
|
+
|
|
def _rolling_ave(self, time_diff, read_diff, last_ave, epsilon):
|
|
"""perform a "rolling average" iteration
|
|
a rolling average "folds" new data into an existing average with
|
|
some weight, epsilon. epsilon must be between 0.0 and 1.0 (inclusive)
|
|
a value of 0.0 means only the old value (initial value) counts,
|
|
and a value of 1.0 means only the newest value is considered."""
|
|
-
|
|
+
|
|
try:
|
|
recent_rate = read_diff / time_diff
|
|
except ZeroDivisionError:
|
|
@@ -437,7 +437,7 @@ class RateEstimator:
|
|
rt = int(rt)
|
|
if shift <= 0: return rt
|
|
return float(int(rt) >> shift << shift)
|
|
-
|
|
+
|
|
|
|
def format_time(seconds, use_hours=0):
|
|
if seconds is None or seconds < 0:
|
|
@@ -455,7 +455,7 @@ def format_time(seconds, use_hours=0):
|
|
return '%02i:%02i:%02i' % (hours, minutes, seconds)
|
|
else:
|
|
return '%02i:%02i' % (minutes, seconds)
|
|
-
|
|
+
|
|
def format_number(number, SI=0, space=' '):
|
|
"""Turn numbers into human-readable metric-like numbers"""
|
|
symbols = ['', # (none)
|
|
@@ -467,14 +467,14 @@ def format_number(number, SI=0, space=' '):
|
|
'E', # exa
|
|
'Z', # zetta
|
|
'Y'] # yotta
|
|
-
|
|
+
|
|
if SI: step = 1000.0
|
|
else: step = 1024.0
|
|
|
|
thresh = 999
|
|
depth = 0
|
|
max_depth = len(symbols) - 1
|
|
-
|
|
+
|
|
# we want numbers between 0 and thresh, but don't exceed the length
|
|
# of our list. In that event, the formatting will be screwed up,
|
|
# but it'll still show the right number.
|
|
@@ -492,5 +492,5 @@ def format_number(number, SI=0, space=' '):
|
|
format = '%.1f%s%s'
|
|
else:
|
|
format = '%.0f%s%s'
|
|
-
|
|
+
|
|
return(format % (float(number or 0), space, symbols[depth]))
|