aboutsummaryrefslogtreecommitdiffstats
path: root/mageiaSync
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2023-01-21 14:25:22 +0100
committerPapoteur <papoteur@mageia.org>2023-01-21 14:25:22 +0100
commit67dd9f79f56e91de643832f0849722a75466deea (patch)
tree635413fc2d7dec4e4239f20955019ff4653963c6 /mageiaSync
parentb00c767c75ffe316e161b44e65a08381369e7ec5 (diff)
downloadMageiaSync-67dd9f79f56e91de643832f0849722a75466deea.tar
MageiaSync-67dd9f79f56e91de643832f0849722a75466deea.tar.gz
MageiaSync-67dd9f79f56e91de643832f0849722a75466deea.tar.bz2
MageiaSync-67dd9f79f56e91de643832f0849722a75466deea.tar.xz
MageiaSync-67dd9f79f56e91de643832f0849722a75466deea.zip
more robust number conversion when reading download speed
Diffstat (limited to 'mageiaSync')
-rw-r--r--mageiaSync/mageiaSyncExt.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mageiaSync/mageiaSyncExt.py b/mageiaSync/mageiaSyncExt.py
index b57fef8..05274d6 100644
--- a/mageiaSync/mageiaSyncExt.py
+++ b/mageiaSync/mageiaSyncExt.py
@@ -152,7 +152,7 @@ class syncThread(QThread):
remain=re.findall("[0-9]*:[0-9]*:[0-9]*",buf)
sizeB=re.findall("[1-9](?:\d{0,2})(?:,\d{3})*",buf)
if len(progressL) != 0:
- progress= eval(progressL[0])
+ progress= float(progressL[0])
self.progressSignal.emit(progress)
if len(sizeB) != 0:
self.sizeSignal.emit(sizeB[0].replace(","," "))
@@ -160,10 +160,10 @@ class syncThread(QThread):
if (len(buf) !=0):
self.lvM.emit(buf.rstrip())
if len(speedK) != 0:
- speed= eval(speedK[0])
+ speed= float(speedK[0])
self.speedSignal.emit(speed)
if len(speedM) != 0:
- speed= 1024*eval(speedM[0])
+ speed= 1024*float(speedM[0])
self.speedSignal.emit(speed)
if len(remain) != 0:
self.remainSignal.emit(remain[0])