diff --git a/dbus_service/dbus-service b/dbus_service/dbus-service index 031a089..82abb4f 100755 --- a/dbus_service/dbus-service +++ b/dbus_service/dbus-service @@ -158,11 +158,9 @@ class Device(dbus.service.Object): logging.exception(e) self.EnrollStatus('enroll-failed', True) - if index == None: - logging.exception( - 'Unknown finger name passed to enroll? ' + - finger_name + ' (' + winbio_name + ')' - ) + if index is None: + logging.exception('Unknown finger name passed to enroll? ' + finger_name + ' (' + + winbio_name + ')') self.EnrollStatus('enroll-failed', True) else: thread = Thread(target=run) diff --git a/scripts/factory-reset.py b/scripts/factory-reset.py index 9ef5ced..377513f 100644 --- a/scripts/factory-reset.py +++ b/scripts/factory-reset.py @@ -1,5 +1,5 @@ -from validitysensor.usb import usb from validitysensor.sensor import factory_reset, RebootException +from validitysensor.usb import usb try: usb.open() diff --git a/scripts/lsdbus.py b/scripts/lsdbus.py index 9ad1770..fc66776 100755 --- a/scripts/lsdbus.py +++ b/scripts/lsdbus.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import dbus.mainloop.glib + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() diff --git a/scripts/prototype.py b/scripts/prototype.py index 3a64e40..7addf46 100644 --- a/scripts/prototype.py +++ b/scripts/prototype.py @@ -2,7 +2,6 @@ from binascii import hexlify from validitysensor.sensor import sensor - # usb.trace_enabled = True # tls.trace_enabled = True diff --git a/validitysensor/db.py b/validitysensor/db.py index e55cbd9..bb21ff1 100644 --- a/validitysensor/db.py +++ b/validitysensor/db.py @@ -1,6 +1,6 @@ +import typing from binascii import hexlify from struct import pack, unpack -import typing from .blobs import db_write_enable from .flash import call_cleanups diff --git a/validitysensor/flash.py b/validitysensor/flash.py index 5030018..54c5240 100644 --- a/validitysensor/flash.py +++ b/validitysensor/flash.py @@ -80,7 +80,8 @@ class ModuleInfo: class FirmwareInfo: - def __init__(self, major: int, minor: int, buildtime: int, modules: typing.Sequence[ModuleInfo]): + def __init__(self, major: int, minor: int, buildtime: int, + modules: typing.Sequence[ModuleInfo]): self.major, self.minor, self.buildtime, self.modules = major, minor, buildtime, modules def __repr__(self): diff --git a/validitysensor/sensor.py b/validitysensor/sensor.py index 3a4b91b..a135641 100644 --- a/validitysensor/sensor.py +++ b/validitysensor/sensor.py @@ -408,7 +408,8 @@ class Sensor: return key_line - def line_update_type_1(self, mode: CaptureMode, chunks: typing.List[typing.List[typing.Union[int, bytes]]]): + def line_update_type_1(self, mode: CaptureMode, + chunks: typing.List[typing.List[typing.Union[int, bytes]]]): for c in chunks: # Timeslot Table 2D if c[0] == 0x34: @@ -511,11 +512,12 @@ class Sensor: return chunks - def line_update_type_2(self, mode: CaptureMode, chunks: typing.List[typing.List[typing.Union[int, bytes]]]): + def line_update_type_2(self, mode: CaptureMode, + chunks: typing.List[typing.List[typing.Union[int, bytes]]]): for c in chunks: # patch the 2D params. # The following is only needed on some rom versions below 6.5 as reported by cmd_01 - #if c[0] == 0x2f: + # if c[0] == 0x2f: # c[1] = pack(' 0: l.data += b'\0' * (4 - pad) - #---------------- Line Update --------------- + # ---------------- Line Update --------------- line_update = pack('