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
  • !821

receiver: fix error when settings listed on descriptor.py return None

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/viniciusbm/reprog_keys_fix_none into master Jun 20, 2020
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: viniciusbm

The implementation of feature_map_choices_dynamic returns None when no choices are available.

https://github.com/pwr-Solaar/Solaar/blob/c5ca2c2818fdd81647b2959a9433edf333e4af2b/lib/logitech_receiver/settings_templates.py#L158-L160

In that case, None should not be stored among real settings, otherwise several errors occur when the setting is listed on descriptors.py. Example of error:

File "…/Solaar/lib/solaar/ui/window.py", line 381, in _device_selected
    _update_info_panel(device, full=True)
  File "…/Solaar/lib/solaar/ui/window.py", line 721, in _update_info_panel
    _update_device_panel(device, _info._device, _info._buttons, full)
  File "…/Solaar/lib/solaar/ui/window.py", line 692, in _update_device_panel
    _config_panel.update(device, is_online)
  File "…/Solaar/lib/solaar/ui/config_panel.py", line 282, in update
    for s in device.settings:
  File "…/Solaar/lib/logitech_receiver/receiver.py", line 256, in settings
    self._feature_settings_checked =_check_feature_settings(self, self._settings)
  File "…/Solaar/lib/logitech_receiver/settings_templates.py", line 540, in check_feature_settings
    check_feature(_REPROGRAMMABLE_KEYS[0], _F.REPROG_CONTROLS_V4)
  File "…/Solaar/lib/logitech_receiver/settings_templates.py", line 513, in check_feature
    if any(s.name == name for s in already_known):
  File "…/Solaar/lib/logitech_receiver/settings_templates.py", line 513, in <genexpr>
    if any(s.name == name for s in already_known):
AttributeError: 'NoneType' object has no attribute 'name'

To fix that, we just have to remove the None values after this: https://github.com/pwr-Solaar/Solaar/blob/c5ca2c2818fdd81647b2959a9433edf333e4af2b/lib/logitech_receiver/receiver.py#L252

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