diff options
author | André Glüpker <git@wgmd.de> | 2016-04-08 10:07:57 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2016-04-08 10:07:57 +0200 |
commit | 448016ddd7b450ee6b0a5f28798d076c16d540c0 (patch) | |
tree | 971e737c7de2ca996d2c3210cb80d0a04df97848 | |
parent | a3af85f43e5763762b760708bf2d443abe29e553 (diff) | |
download | 9kwpyqt-448016ddd7b450ee6b0a5f28798d076c16d540c0.tar.gz 9kwpyqt-448016ddd7b450ee6b0a5f28798d076c16d540c0.tar.bz2 9kwpyqt-448016ddd7b450ee6b0a5f28798d076c16d540c0.zip |
Another check for well-formatted server stats
-rwxr-xr-x | 9kwpyqt.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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(): |