From 448016ddd7b450ee6b0a5f28798d076c16d540c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Fri, 8 Apr 2016 10:07:57 +0200 Subject: Another check for well-formatted server stats --- 9kwpyqt.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/9kwpyqt.py b/9kwpyqt.py index f23cea7..cbc84be 100755 --- a/9kwpyqt.py +++ b/9kwpyqt.py @@ -219,14 +219,15 @@ class CaptchaGUI(QWidget): self.networkQueueReply.finished.connect(self.getQueueFinished) def getQueueFinished(self): + # Should be name=value|name2=value2|name3=value3... content = str(self.networkQueueReply.readAll(), encoding='utf-8') datatmp = content.split('|') data = dict() for stat in datatmp: - tmp = stat.split('=') - data[tmp[0]] = tmp[1] - self.currentQueued = 0 - self.currentWorker = 0 + if '=' in stat: + tmp = stat.split('=') + data[tmp[0]] = tmp[1] + self.currentQueued = self.currentWorker = 0 if 'queue' in data and data['queue'].isnumeric(): self.currentQueued = int(data['queue']) if 'workertext' in data and data['workertext'].isnumeric(): -- cgit v1.2.3