python-pillow / python-pillow/Sane
Cannot push virtual buttons
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 61
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Via the C-interface, it is perfectly possible to push virtual buttons, simply by using set_option() with an arbitrary value. The python bindings prevent this, however:
>>> import sane
>>> sane.init()
(16842753, 1, 1, 1)
>>> scanner=sane.open("test")
>>> scanner.enable_test_options = True
>>> scanner.button = True
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/sane.py", line 196, in __setattr__
raise AttributeError("Buttons don't have values: " + key)
AttributeError: Buttons don't have values: button
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Python binding shown in /usr/lib/python3.10/site-packages/sane.py, especially setattr, and compare its button handling with the C interface's set_option() behavior. Confirm how virtual buttons are represented and make the binding permit the operation; done means the demonstrated scanner.button assignment no longer raises the AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100