Cannot push virtual buttons

Aperta
#92 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c, python
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C
Stelle
61
Fork
22
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-pillow/Sane

Tutte le issue di python-pillow/Sane

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.