summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2016-04-08 10:07:57 +0200
committerAndré Glüpker <git@wgmd.de>2016-04-08 10:07:57 +0200
commit448016ddd7b450ee6b0a5f28798d076c16d540c0 (patch)
tree971e737c7de2ca996d2c3210cb80d0a04df97848
parenta3af85f43e5763762b760708bf2d443abe29e553 (diff)
download9kwpyqt-448016ddd7b450ee6b0a5f28798d076c16d540c0.tar.gz
9kwpyqt-448016ddd7b450ee6b0a5f28798d076c16d540c0.tar.bz2
9kwpyqt-448016ddd7b450ee6b0a5f28798d076c16d540c0.zip
Another check for well-formatted server stats
-rwxr-xr-x9kwpyqt.py9
1 files 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():