From dbb9025e26bbb20da72b2589739119f63b942722 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Mon, 8 Jul 2013 21:21:14 +0200 Subject: [PATCH] replaced _ dummies with _ignore --- lib/hidapi/udev.py | 2 +- lib/solaar/ui/config_panel.py | 6 +++--- lib/solaar/ui/tray.py | 18 +++++++++--------- lib/solaar/ui/window.py | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/hidapi/udev.py b/lib/hidapi/udev.py index d18af1e0..d81a813d 100644 --- a/lib/hidapi/udev.py +++ b/lib/hidapi/udev.py @@ -326,7 +326,7 @@ def get_indexed_string(device_handle, index): hid_dev = dev.find_parent('hid') if hid_dev: assert 'HID_ID' in hid_dev - bus, _, _ = hid_dev['HID_ID'].split(':') + bus, _ignore, _ignore = hid_dev['HID_ID'].split(':') if bus == '0003': # USB usb_dev = dev.find_parent('usb', 'usb_device') diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py index b597dfcb..62d2468c 100644 --- a/lib/solaar/ui/config_panel.py +++ b/lib/solaar/ui/config_panel.py @@ -23,7 +23,7 @@ def _read_async(setting, force_read, sbox, device_is_online): def _write_async(setting, value, sbox): - _, failed, spinner, control = sbox.get_children() + _ignore, failed, spinner, control = sbox.get_children() control.set_sensitive(False) failed.set_visible(False) spinner.set_visible(True) @@ -40,7 +40,7 @@ def _write_async(setting, value, sbox): # def _create_toggle_control(setting): - def _switch_notify(switch, _, s): + def _switch_notify(switch, _ignore, s): if switch.get_sensitive(): _write_async(s, switch.get_active() == True, switch.get_parent()) @@ -108,7 +108,7 @@ def _create_sbox(s): def _update_setting_item(sbox, value, is_online=True): - _, failed, spinner, control = sbox.get_children() + _ignore, failed, spinner, control = sbox.get_children() spinner.set_visible(False) spinner.stop() diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index f685289b..ca4ec655 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -58,7 +58,7 @@ try: _log.info("using AppIndicator3") _last_scroll = 0 - def _scroll(ind, _, direction): + def _scroll(ind, _ignore, direction): if direction != ScrollDirection.UP and direction != ScrollDirection.DOWN: # ignore all other directions return @@ -152,7 +152,7 @@ try: def _update_tray_icon(): if _picked_device: - _, _, name, device_status = _picked_device + _ignore, _ignore, name, device_status = _picked_device battery_level = device_status.get(_K.BATTERY_LEVEL) battery_charging = device_status.get(_K.BATTERY_CHARGING) tray_icon_name = _icons.battery(battery_level, battery_charging) @@ -211,7 +211,7 @@ except ImportError: _icon.set_tooltip_markup(tooltip) if _picked_device: - _, _, name, device_status = _picked_device + _ignore, _ignore, name, device_status = _picked_device battery_level = device_status.get(_K.BATTERY_LEVEL) battery_charging = device_status.get(_K.BATTERY_CHARGING) tray_icon_name = _icons.battery(battery_level, battery_charging) @@ -255,7 +255,7 @@ def _generate_tooltip_lines(): yield '%s' % NAME yield '' - for _, number, name, status in _devices_info: + for _ignore, number, name, status in _devices_info: if number is None: # receiver continue @@ -307,7 +307,7 @@ def _add_device(device): assert receiver_path index = None - for idx, (path, _, _, _) in enumerate(_devices_info): + for idx, (path, _ignore, _ignore, _ignore) in enumerate(_devices_info): if path == receiver_path: # the first entry matching the receiver serial should be for the receiver itself index = idx + 1 @@ -316,7 +316,7 @@ def _add_device(device): # proper ordering (according to device.number) for a receiver's devices while True: - path, number, _, _ = _devices_info[index] + path, number, _ignore, _ignore = _devices_info[index] if path == _RECEIVER_SEPARATOR[0]: break assert path == receiver_path @@ -382,7 +382,7 @@ def _remove_receiver(receiver): # remove all entries in devices_info that match this receiver while index < len(_devices_info): - path, _, _, _ = _devices_info[index] + path, _ignore, _ignore, _ignore = _devices_info[index] if path == receiver.path: found = True _remove_device(index) @@ -455,7 +455,7 @@ def update(device=None): receiver_path = device.path if is_alive: index = None - for idx, (path, _, _, _) in enumerate(_devices_info): + for idx, (path, _ignore, _ignore, _ignore) in enumerate(_devices_info): if path == receiver_path: index = idx break @@ -470,7 +470,7 @@ def update(device=None): is_paired = bool(device) receiver_path = device.receiver.path index = None - for idx, (path, number, _, _) in enumerate(_devices_info): + for idx, (path, number, _ignore, _ignore) in enumerate(_devices_info): if path == receiver_path and number == device.number: index = idx diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index 2a1741ac..cb2e55b0 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -240,7 +240,7 @@ def _create_tree(model): tree.set_enable_search(False) tree.set_model(model) - def _is_separator(model, item, _=None): + def _is_separator(model, item, _ignore=None): return model.get_value(item, _COLUMN.PATH) is None tree.set_row_separator_func(_is_separator, None) @@ -446,7 +446,7 @@ def select(receiver_path, device_number=None): _log.warn("select(%s, %s) failed to find an item", receiver_path, device_number) -def _hide(w, _=None): +def _hide(w, _ignore=None): assert w == _window # some window managers move the window to 0,0 after hide() # so try to remember the last position