sane.py return incorrect value for options with same name as scanDev attribute (found while trying to get the value for the 'scan' button on a Canon Lide 110 scanner).

A simple patch is provided, but IMHO the sane.py module could do with some cleaning up (how about making it more object oriented...)?


--- sane.py     2012-09-12 18:44:41.279360763 +0200
+++ Imaging-1.1.7/Sane/sane.py  2009-11-01 01:44:12.000000000 +0100
@@ -70,7 +70,7 @@
             settable = 'no'
         if self.is_active():
             active = 'yes'
-            curValue = repr(self.scanDev.__getattr__(self.py_name))
+            curValue = repr(getattr(self.scanDev, self.py_name))
         else:
             active = 'no'
             curValue = '<not available, inactive option>'

--
Anders Blomdell                  Email: anders.blomd...@control.lth.se
Department of Automatic Control
Lund University                  Phone:    +46 46 222 4625
P.O. Box 118                     Fax:      +46 46 138118
SE-221 00 Lund, Sweden

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to