Browse Source

resolve issues identified by pyflakes

Helge Jung 9 years ago
parent
commit
5e0ca7ad13
4 changed files with 4 additions and 13 deletions
  1. 0 1
      batcave.py
  2. 1 4
      ffstatus/alfred.py
  3. 2 6
      ffstatus/batman.py
  4. 1 2
      ffstatus/server.py

+ 0 - 1
batcave.py

@@ -1,7 +1,6 @@
 #!/usr/bin/python
 from __future__ import print_function
 import argparse
-from copy import deepcopy
 import daemon
 import logging
 import sys

+ 1 - 4
ffstatus/alfred.py

@@ -1,13 +1,10 @@
 #!/usr/bin/python
 
 from __future__ import print_function
-from copy import deepcopy
 import io
 import json
-import socket
 import subprocess
 import time
-import StringIO
 
 class AlfredParser:
 	alfred_json = 'alfred-json'
@@ -24,7 +21,7 @@ class AlfredParser:
 			raise Exception("alfred-json not found or incompatible: " + str(err))
 
 		try:
-			check = json.loads(testdata)
+			json.loads(testdata)
 		except Exception as err:
 			raise Exception("alfred-json does not return valid JSON data: " + str(err))
 

+ 2 - 6
ffstatus/batman.py

@@ -1,15 +1,12 @@
 #!/usr/bin/python
 
 from __future__ import print_function
-from copy import deepcopy
 import io
 import json
-import socket
+import string
 import subprocess
 import time
 
-import string
-import StringIO
 
 class BatmanParser:
 	batadv_vis = 'batadv-vis'
@@ -28,7 +25,7 @@ class BatmanParser:
 			raise Exception("batadv-vis not found or incompatible: " + str(err))
 
 		try:
-			check = json.loads(testdata)
+			json.loads(testdata)
 		except Exception as err:
 			raise Exception("batadv-vis does not return valid JSON data: " + str(err))
 
@@ -53,7 +50,6 @@ class BatmanParser:
 
 		# dump raw data into file if requested
 		if not batadv_dump is None:
-			jsondata = json.dumps(batmandata, ensure_ascii=False)
 			f = io.open(batadv_dump, 'w')
 			f.write(rawdata)
 			f.close()

+ 1 - 2
ffstatus/server.py

@@ -297,7 +297,7 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
 		self.wfile.write(status)
 
 	def respond_nodeidmac2name(self, ids):
-		storage = self.server.storage
+		"""Return a mapping of the given IDs (or MACs) into their hostname."""
 
 		self.send_headers('text/plain')
 		for nodeid in ids:
@@ -420,7 +420,6 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
 				for t in [ 'active', 'last' ]:
 					for gw in gateways:
 						ip = ''
-						details = ''
 						if t in item and gw in item[t]:
 							ip = item[t][gw]['remote'] if 'remote' in item[t][gw] else ''
 						self.wfile.write('<td title="' + ip + '">' + ('&check;' if len(ip) > 0 else '&times;') + '</td>')