From 0520eda628eab626b8e698e8166a9d72798d92ce Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 23 Aug 2016 10:36:20 +0200 Subject: [PATCH] device manager: remove seemingly unused parameter --- lib/plugins.py | 10 +++++----- plugins/trezor/plugin.py | 5 ++--- plugins/trezor/qt_generic.py | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/plugins.py b/lib/plugins.py index 1024daed..ba885aa7 100644 --- a/lib/plugins.py +++ b/lib/plugins.py @@ -379,15 +379,15 @@ class DeviceMgr(ThreadJob, PrintError): return client return None - def client_by_id(self, id_, handler): + def client_by_id(self, id_): '''Returns a client for the device ID if one is registered. If a device is wiped or in bootloader mode pairing is impossible; in such cases we communicate by device ID and not wallet.''' - self.scan_devices(handler) + self.scan_devices() return self.client_lookup(id_) def client_for_xpub(self, plugin, xpub, derivation, handler, force_pair): - devices = self.scan_devices(handler) + devices = self.scan_devices() _id = self.xpub_id(xpub) client = self.client_lookup(_id) if client: @@ -436,7 +436,7 @@ class DeviceMgr(ThreadJob, PrintError): '''Returns a list of DeviceInfo objects: one for each connected, unpaired device accepted by the plugin.''' if devices is None: - devices = self.scan_devices(handler) + devices = self.scan_devices() devices = [dev for dev in devices if not self.xpub_by_id(dev.id_)] states = [_("wiped"), _("initialized")] @@ -474,7 +474,7 @@ class DeviceMgr(ThreadJob, PrintError): descriptions = [info.description for info in infos] return infos[handler.query_choice(msg, descriptions)] - def scan_devices(self, handler): + def scan_devices(self): # All currently supported hardware libraries use hid, so we # assume it here. This can be easily abstracted if necessary. # Note this import must be local so those without hardware diff --git a/plugins/trezor/plugin.py b/plugins/trezor/plugin.py index d23ccfa2..01fabfa8 100644 --- a/plugins/trezor/plugin.py +++ b/plugins/trezor/plugin.py @@ -178,7 +178,7 @@ class TrezorCompatiblePlugin(HW_PluginBase): language = 'english' devmgr = self.device_manager() - client = devmgr.client_by_id(device_id, handler) + client = devmgr.client_by_id(device_id) if method == TIM_NEW: strength = 64 * (item + 2) # 128, 192 or 256 @@ -209,8 +209,7 @@ class TrezorCompatiblePlugin(HW_PluginBase): device_id = device_info.device.id_ if not device_info.initialized: self.initialize_device(device_id, wizard, handler) - - client = devmgr.client_by_id(device_id, handler) + client = devmgr.client_by_id(device_id) client.used() return client.get_xpub(derivation) diff --git a/plugins/trezor/qt_generic.py b/plugins/trezor/qt_generic.py index e6db6528..26b3d3e2 100644 --- a/plugins/trezor/qt_generic.py +++ b/plugins/trezor/qt_generic.py @@ -333,7 +333,7 @@ class SettingsDialog(WindowModalDialog): unpair_after = kw_args.pop('unpair_after', False) def task(): - client = devmgr.client_by_id(device_id, handler) + client = devmgr.client_by_id(device_id) if not client: raise RuntimeError("Device not connected") if method: