Cannot push virtual buttons
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
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.
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
- Dominant language
- C
- Stars
- 61
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
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.
More from python-pillow/Sane
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
python-pillow/Sane#110 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
python-pillow/Sane#107 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
python-pillow/Sane#103 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
python-pillow/Sane#93 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
python-pillow/Sane#81 · 1 comment ·
All issues in python-pillow/Sane
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
libsdl-org/SDL#16372 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
corazawaf/coraza-nginx#140 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
jamesstringer90/appsandbox#160 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100