sane.Option doesn't properly handle buttons named "scan"
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start by reading sane.py around line 307 and the SaneDev.scan method, then reproduce the collision with scanner.opt['scan'] using the example in the issue. Determine how option names and SaneDev methods are exposed together; done means the scan button remains accessible as an option while the scanner can still be asked to begin scanning.
Written by the indexing model from the issue text.
Description
I have a couple of scanners (a Fujitsu SnapScan 1500 and a Canon CanoScan LiDE 210) that have front-panel buttons that can initiate scans. Unfortunately, the primary scan buttons are named "scan" and that collides with the bound method to ask the scanner to begin scanning.
>>> import sane
>>>
>>> sane.init()
(16777247, 1, 0, 31)
>>> sane.get_devices()
[('genesys:libusb:001:008', 'Canon', 'LiDE 210', 'flatbed scanner'), ('fujitsu:ScanSnap S1500:56050', 'FUJITSU', 'ScanSnap S1500', 'scanner')]
>>>
>>> scanner = sane.open('fujitsu:ScanSnap S1500:56050')
>>> scanner.opt['scan']
Name: scan
Cur value: <bound method SaneDev.scan of <sane.SaneDev object at 0x7f8567e60f40>>
Index: 91
Title: Scan button
Desc: Scan button
Type: TYPE_BOOL
Unit: UNIT_NONE
Constr: None
active: yes
settable: no
Modifying sane.py on line 307 to change the method name from scan to, say, doscan "fixes" the issue for me:
>>> scanner.opt['scan']
Name: scan
Cur value: 0
Index: 91
Title: Scan button
Desc: Scan button
Type: TYPE_BOOL
Unit: UNIT_NONE
Constr: None
active: yes
settable: no
I'm not sure what the proper way to fix this for real. :/
- 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 3/5 1-2 days Newbie friendliness 35/100
python-pillow/Sane#92 ·
All issues in python-pillow/Sane
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·