diff options
author | Papoteur <papoteur@mageia.org> | 2023-01-21 14:25:22 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2023-01-21 14:25:22 +0100 |
commit | 67dd9f79f56e91de643832f0849722a75466deea (patch) | |
tree | 635413fc2d7dec4e4239f20955019ff4653963c6 /mageiaSync | |
parent | b00c767c75ffe316e161b44e65a08381369e7ec5 (diff) | |
download | MageiaSync-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.py | 6 |
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]) |