Quellcode durchsuchen

fix bugs / its working now :D

Marcus Scharf vor 7 Jahren
Ursprung
Commit
a60e0b4c6e
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 1 1
      lib/respondd.py
  2. 3 3
      lib/respondd_client.py

+ 1 - 1
lib/respondd.py

@@ -32,7 +32,7 @@ class Respondd:
     return j
 
   def getJSON(self, root=None):
-    return bytes(json.dumps(self.getStruct(), separators=(',', ':')), 'UTF-8')
+    return bytes(json.dumps(self.getStruct(root), separators=(',', ':')), 'UTF-8')
 
   def getJSONCompressed(self, root=None):
     return self.compress(self.getJSON(root))

+ 3 - 3
lib/respondd_client.py

@@ -75,11 +75,11 @@ class ResponddClient:
 
     if not self._config["dry_run"]:
       if compress:
-        sock.sendto(response.getJSONCompressed(request), sender)
+        self._sock.sendto(response.getJSONCompressed(request), sender)
       else:
-        sock.sendto(response.getJSON(request), sender)
+        self._sock.sendto(response.getJSON(request), sender)
 
     if self._config["verbose"] or self._config["dry_run"]:
       print("%35s %5d %13s: " % (sender[0], sender[1], request), end='')
-      print(json.dumps(response.getStruct(), sort_keys=True, indent=4))
+      print(json.dumps(response.getStruct(request), sort_keys=True, indent=4))