replaced _ dummies with _ignore

This commit is contained in:
Daniel Pavel 2013-07-08 21:21:14 +02:00
parent beee0bc8c2
commit dbb9025e26
4 changed files with 15 additions and 15 deletions

View File

@ -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')

View File

@ -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()

View File

@ -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 '<b>%s</b>' % 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

View File

@ -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