diff options
author | nico <nico@magicbroccoli.de> | 2018-11-09 19:42:21 +0100 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2018-11-09 19:42:21 +0100 |
commit | cd1442e216abf564daceaef5fe45555587eef69b (patch) | |
tree | ec8e7c27707619c439bd14396db3b1a9e15387dc /classes | |
parent | d1b8090ee8f773628cc5eb04971b575debfec249 (diff) |
code quality improvements
- remove unused variable
* better iteration of xdata nodes
- removed unnecessary else
Diffstat (limited to 'classes')
-rw-r--r-- | classes/servercontact.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/classes/servercontact.py b/classes/servercontact.py index ea7216d..749a2c3 100644 --- a/classes/servercontact.py +++ b/classes/servercontact.py @@ -34,11 +34,11 @@ class ServerContact: # extract jabber:x:data from query xdata = query.findall('{jabber:x:data}x') - # check for multiple x nodes - for x in range(len(xdata)): + # iterate over all nodes with the xdata tag + for node in xdata: - # iterate over all x nodes - for child in xdata[x]: + # iterate over all child elements in node + for child in node: # if one opt_arg is defined return just that one if self.opt_arg in self.possible_vars: |