Make pylint more strict (#1626)

* make pylint more strict

* cleanup in progress

* done cleaning up

* no opendbc
old-commit-hash: 843a64c72fb94397a1edf814fa66044c8d92acbf
This commit is contained in:
Willem Melching
2020-06-02 16:29:32 -07:00
committed by GitHub
parent a03da046c3
commit a56e2b01f8
65 changed files with 313 additions and 359 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ class ClientRedirectHandler(BaseHTTPRequestHandler):
self.end_headers()
self.wfile.write(b'Return to the CLI to continue')
def log_message(self, format, *args):
def log_message(self, format, *args): # pylint: disable=redefined-builtin
pass # this prevent http server from dumping messages to stdout
def auth_redirect_link(port):
+1 -1
View File
@@ -54,7 +54,7 @@ class KBHit:
def kbhit(self):
''' Returns True if keyboard character was hit, False otherwise.
'''
dr, dw, de = select([sys.stdin], [], [], 0)
dr, _, _ = select([sys.stdin], [], [], 0)
return dr != []
+3 -2
View File
@@ -1,6 +1,7 @@
"""RouteFrameReader indexes and reads frames across routes, by frameId or segment indices."""
from tools.lib.framereader import FrameReader
class _FrameReaderDict(dict):
def __init__(self, camera_paths, cache_paths, framereader_kwargs, *args, **kwargs):
super(_FrameReaderDict, self).__init__(*args, **kwargs)
@@ -8,7 +9,7 @@ class _FrameReaderDict(dict):
if cache_paths is None:
cache_paths = {}
if not isinstance(cache_paths, dict):
cache_paths = { k: v for k, v in enumerate(cache_paths) }
cache_paths = {k: v for k, v in enumerate(cache_paths)}
self._camera_paths = camera_paths
self._cache_paths = cache_paths
@@ -84,5 +85,5 @@ class RouteFrameReader(object):
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
def __exit__(self, exc_type, exc_value, traceback):
self.close()
+1 -1
View File
@@ -3,7 +3,7 @@ import os
from common.basedir import BASEDIR
os.environ['BASEDIR'] = BASEDIR
SCALE = float(os.getenv("SCALE", 1.0))
SCALE = float(os.getenv("SCALE", "1"))
import argparse
import pygame # pylint: disable=import-error
+5 -5
View File
@@ -5,10 +5,10 @@ import sys
import zmq
import time
import signal
import multiprocessing
from uuid import uuid4
from collections import namedtuple
from collections import deque
from multiprocessing import Process, TimeoutError
from datetime import datetime
# strat 1: script to copy files
@@ -404,11 +404,11 @@ def main(argv):
subprocesses = {}
try:
subprocesses["data"] = Process(
subprocesses["data"] = multiprocessing.Process(
target=UnloggerWorker().run,
args=(forward_commands_address, data_address, address_mapping.copy()))
subprocesses["control"] = Process(
subprocesses["control"] = multiprocessing.Process(
target=unlogger_thread,
args=(command_address, forward_commands_address, data_address, args.realtime,
_get_address_mapping(args), args.publish_time_length, args.bind_early, args.no_loop))
@@ -421,7 +421,7 @@ def main(argv):
# Exit if any of the children die.
def exit_if_children_dead(*_):
for name, p in subprocesses.items():
for _, p in subprocesses.items():
if not p.is_alive():
[p.terminate() for p in subprocesses.values()]
exit()
@@ -439,7 +439,7 @@ def main(argv):
if p.is_alive():
try:
p.join(3.)
except TimeoutError:
except multiprocessing.TimeoutError:
p.terminate()
continue
return 0
+3 -5
View File
@@ -97,11 +97,9 @@ def go(q):
world.set_weather(weather)
blueprint_library = world.get_blueprint_library()
"""
for blueprint in blueprint_library.filter('sensor.*'):
print(blueprint.id)
exit(0)
"""
# for blueprint in blueprint_library.filter('sensor.*'):
# print(blueprint.id)
# exit(0)
world_map = world.get_map()
vehicle_bp = random.choice(blueprint_library.filter('vehicle.tesla.*'))
+1 -1
View File
@@ -143,7 +143,7 @@ def wheel_poll_thread(q):
while True:
evbuf = jsdev.read(8)
time, value, mtype, number = struct.unpack('IhBB', evbuf)
_, value, mtype, number = struct.unpack('IhBB', evbuf)
# print(mtype, number, value)
if mtype & 0x02: # wheel & paddles
axis = axis_map[number]