Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S Solaar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pwr-Solaar
  • Solaar
  • Merge requests
  • !864

Idle devices - exceptions caused by dynamic features

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/viniciusbm/idle_exception_fix into master Jul 21, 2020
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: viniciusbm

The implementation of dynamic features causes some exceptions when we click the name of an idle device. An example:

Traceback (most recent call last):
  File "…/Solaar/lib/solaar/ui/window.py", line 395, in _device_selected
    _update_info_panel(device, full=True)
  File "…/Solaar/lib/solaar/ui/window.py", line 759, in _update_info_panel
    _update_device_panel(device, _info._device, _info._buttons, full)
  File "…/Solaar/lib/solaar/ui/window.py", line 730, in _update_device_panel
    _config_panel.update(device, is_online)
  File "…/Solaar/lib/solaar/ui/config_panel.py", line 292, in update
    for s in device.settings:
  File "…/Solaar/lib/logitech_receiver/receiver.py", line 275, in settings
    self._settings = [s(self) for s in self.descriptor.settings]
  File "…/Solaar/lib/logitech_receiver/receiver.py", line 275, in <listcomp>
    self._settings = [s(self) for s in self.descriptor.settings]
  File "…/Solaar/lib/logitech_receiver/settings_templates.py", line 178, in instantiate
    choices = choices_callback(device)
  File "…/Solaar/lib/logitech_receiver/settings_templates.py", line 532, in _feature_reprogrammable_keys_choices
    assert count, 'Oops, reprogrammable key count cannot be retrieved!'
AssertionError: Oops, reprogrammable key count cannot be retrieved!

Solaar still works as expected and no errors are shown if we do that when the device is online, so this is not a big problem. I think it's worth fixing it anyway, especially because those meaningless error messages may be confusing to users and can make it harder to debug real problems.

This change catches the exceptions and raises them again only if the device is online. I'm not sure if this is the best approach, so ideas are welcome.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/viniciusbm/idle_exception_fix