diff --git a/examples/get_panda_password.py b/examples/get_panda_password.py index b8ec3d94..13dacf25 100644 --- a/examples/get_panda_password.py +++ b/examples/get_panda_password.py @@ -13,8 +13,8 @@ def get_panda_password(): wifi = p.get_serial() #print('[%s]' % ', '.join(map(str, wifi))) - print(("SSID: " + wifi[0])) - print(("Password: " + wifi[1])) + print("SSID: " + wifi[0]) + print("Password: " + wifi[1]) if __name__ == "__main__": - get_panda_password() \ No newline at end of file + get_panda_password() diff --git a/examples/tesla_tester.py b/examples/tesla_tester.py index 0c484b07..74f19f25 100644 --- a/examples/tesla_tester.py +++ b/examples/tesla_tester.py @@ -51,10 +51,10 @@ def tesla_tester(): vin_index = int(binascii.hexlify(dat)[:2]) #first byte is the index, 00, 01, 02 vin_string = binascii.hexlify(dat)[2:] #rest of the string is the actual VIN data vin[vin_index] = vin_string.decode("hex") - print(("Got VIN index " + str(vin_index) + " data " + vin[vin_index])) + print("Got VIN index " + str(vin_index) + " data " + vin[vin_index]) #if we have all 3 parts of the VIN, print it and break out of our while loop if 0 in vin and 1 in vin and 2 in vin: - print(("VIN: " + vin[0] + vin[1] + vin[2][:3])) + print("VIN: " + vin[0] + vin[1] + vin[2][:3]) break if __name__ == "__main__": diff --git a/python/esptool.py b/python/esptool.py index 053a4c69..d97c177c 100755 --- a/python/esptool.py +++ b/python/esptool.py @@ -488,14 +488,14 @@ class OTAFirmwareImage(BaseFirmwareImage): (magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack(' 16: raise FatalError('Invalid V2 second header magic=%d segments=%d' % (magic, segments)) @@ -911,8 +911,8 @@ def write_flash(esp, args): t = time.time() flasher.flash_write(address, image, not args.no_progress) t = time.time() - t - print(('\rWrote %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' - % (len(image), address, t, len(image) / t * 8 / 1000))) + print('\rWrote %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' + % (len(image), address, t, len(image) / t * 8 / 1000)) print('Leaving...') if args.verify: print('Verifying just-written flash...') @@ -922,7 +922,7 @@ def write_flash(esp, args): def image_info(args): image = LoadFirmwareImage(args.filename) - print(('Image version: %d' % image.version)) + print('Image version: %d' % image.version) print(('Entry point: %08x' % image.entrypoint) if image.entrypoint != 0 else 'Entry point not set') print('%d segments' % len(image.segments)) print() @@ -1024,8 +1024,8 @@ def read_flash(esp, args): t = time.time() data = flasher.flash_read(args.address, args.size, not args.no_progress) t = time.time() - t - print(('\rRead %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' - % (len(data), args.address, t, len(data) / t * 8 / 1000))) + print('\rRead %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' + % (len(data), args.address, t, len(data) / t * 8 / 1000)) file(args.filename, 'wb').write(data) diff --git a/python/update.py b/python/update.py index a82bbc6a..d72de116 100755 --- a/python/update.py +++ b/python/update.py @@ -38,7 +38,7 @@ def ensure_st_up_to_date(): assert(not panda.bootstub) version = str(panda.get_version()) - print(("%s should be %s" % (version, repo_version))) + print("%s should be %s" % (version, repo_version)) assert(version.startswith(repo_version)) if __name__ == "__main__": diff --git a/tests/automated/helpers.py b/tests/automated/helpers.py index d902b085..651dc44f 100644 --- a/tests/automated/helpers.py +++ b/tests/automated/helpers.py @@ -62,7 +62,7 @@ def _connect_wifi(dongle_id, pw, insecure_okay=False): except: pass - print(("WIFI: connecting to %s" % ssid)) + print("WIFI: connecting to %s" % ssid) while 1: if sys.platform == "darwin": @@ -72,7 +72,7 @@ def _connect_wifi(dongle_id, pw, insecure_okay=False): cnt = 0 MAX_TRIES = 10 while cnt < MAX_TRIES: - print(("WIFI: scanning %d" % cnt)) + print("WIFI: scanning %d" % cnt) os.system("iwlist %s scanning > /dev/null" % wlan_interface) os.system("nmcli device wifi rescan") wifi_scan = filter(lambda x: ssid in x, subprocess.check_output(["nmcli","dev", "wifi", "list"]).split("\n")) @@ -176,7 +176,7 @@ def panda_type_to_serial(fn): if panda_type is not None: if not isinstance(panda_type, list): panda_type = [panda_type] - + # If not done already, get panda serials and their type global _panda_serials if _panda_serials == None: @@ -185,7 +185,7 @@ def panda_type_to_serial(fn): p = Panda(serial=serial) _panda_serials.append((serial, p.get_type())) p.close() - + # Find a panda with the correct types and add the corresponding serial serials = [] for p_type in panda_type: @@ -216,7 +216,7 @@ def panda_connect_and_init(fn): if panda_serials is not None: if not isinstance(panda_serials, list): panda_serials = [panda_serials] - + # Connect to pandas pandas = [] for panda_serial in panda_serials: @@ -247,7 +247,7 @@ def clear_can_buffers(panda): # clear tx buffers for i in range(4): panda.can_clear(i) - + # clear rx buffers panda.can_clear(0xFFFF) r = [1] @@ -256,5 +256,5 @@ def clear_can_buffers(panda): r = panda.can_recv() time.sleep(0.05) if (time.time() - st) > 10: - print(("Unable to clear can buffers for panda ", panda.get_serial())) - assert False \ No newline at end of file + print("Unable to clear can buffers for panda ", panda.get_serial()) + assert False diff --git a/tests/get_version.py b/tests/get_version.py index c505806c..73e51e1f 100755 --- a/tests/get_version.py +++ b/tests/get_version.py @@ -4,6 +4,6 @@ from panda import Panda if __name__ == "__main__": for p in Panda.list(): pp = Panda(p) - print(("%s: %s" % (pp.get_serial()[0], pp.get_version()))) + print("%s: %s" % (pp.get_serial()[0], pp.get_version())) diff --git a/tests/gmbitbang/rigol.py b/tests/gmbitbang/rigol.py index 7118b9cf..f2efb034 100755 --- a/tests/gmbitbang/rigol.py +++ b/tests/gmbitbang/rigol.py @@ -7,7 +7,7 @@ resources = visa.ResourceManager() print(resources.list_resources()) scope = resources.open_resource('USB0::0x1AB1::0x04CE::DS1ZA184652242::INSTR', timeout=2000, chunk_size=1024000) -print((scope.query('*IDN?').strip())) +print(scope.query('*IDN?').strip()) #voltscale = scope.ask_for_values(':CHAN1:SCAL?')[0] #voltoffset = scope.ask_for_values(":CHAN1:OFFS?")[0] diff --git a/tests/gmbitbang/test.py b/tests/gmbitbang/test.py index 321165f8..0934c644 100755 --- a/tests/gmbitbang/test.py +++ b/tests/gmbitbang/test.py @@ -10,8 +10,8 @@ p1.set_safety_mode(Panda.SAFETY_ALLOUTPUT) p2.set_safety_mode(Panda.SAFETY_ALLOUTPUT) # get versions -print((p1.get_version())) -print((p2.get_version())) +print(p1.get_version()) +print(p2.get_version()) # this sets bus 2 to actually be GMLAN p2.set_gmlan(bus=2) diff --git a/tests/health_test.py b/tests/health_test.py index bf502fda..69234c7d 100755 --- a/tests/health_test.py +++ b/tests/health_test.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import time from panda import Panda - + if __name__ == "__main__": panda_serials = Panda.list() pandas = [] @@ -13,7 +13,7 @@ if __name__ == "__main__": while True: for panda in pandas: - print((panda.health())) + print(panda.health()) print("\n") time.sleep(0.5) diff --git a/tests/standalone_test.py b/tests/standalone_test.py index a7f93278..9e181d8f 100755 --- a/tests/standalone_test.py +++ b/tests/standalone_test.py @@ -12,14 +12,14 @@ if __name__ == "__main__": p = Panda("WIFI") else: p = Panda() - print((p.get_serial())) - print((p.health())) + print(p.get_serial()) + print(p.health()) t1 = time.time() for i in range(100): p.get_serial() t2 = time.time() - print(("100 requests took %.2f ms" % ((t2-t1)*1000))) + print("100 requests took %.2f ms" % ((t2-t1)*1000)) p.set_safety_mode(Panda.SAFETY_ALLOUTPUT)