We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee5ca1f commit 6aaf952Copy full SHA for 6aaf952
1 file changed
nut2.py
@@ -262,16 +262,11 @@ def list_rw_vars(self, ups=""):
262
result = self._srv_handler.read_until("END LIST RW %s\n" % ups)
263
offset = len("VAR %s" % ups)
264
end_offset = 0 - (len("END LIST RW %s\n" % ups) + 1)
265
- rw_vars = {}
266
267
- try:
268
- for current in result[:end_offset].split("\n"):
269
- var = current[offset:].split('"')[0].replace(" ", "")
270
- data = current[offset:].split('"')[1]
271
- rw_vars[var] = data
272
- except Exception:
273
- # FIXME: Make this except more specific.
274
- pass
+ rw_vars = {}
+ for current in result[:end_offset].split("\n"):
+ var, data = current[offset:].split('"')[:2]
+ rw_vars[var.strip()] = data
275
276
return rw_vars
277
0 commit comments