From 67dd9f79f56e91de643832f0849722a75466deea Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sat, 21 Jan 2023 14:25:22 +0100 Subject: more robust number conversion when reading download speed --- mageiaSync/mageiaSyncExt.py | 6 +++--- 1 file 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]) -- cgit v1.2.1