projects
/
pycomedi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c81a4ed
)
Allow AnalogChannel.__init__ to take integers for `range`.
author
W. Trevor King
<wking@drexel.edu>
Mon, 19 Mar 2012 17:34:25 +0000
(13:34 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Mon, 19 Mar 2012 17:34:30 +0000
(13:34 -0400)
If you know the index of your desired range, you can now use that
index directly and skip the usual call to `find_range`.
pycomedi/channel.pyx
patch
|
blob
|
history
diff --git
a/pycomedi/channel.pyx
b/pycomedi/channel.pyx
index 76bb5eba9496ccf1fe7741c95bd594fa762afc34..69bd8780eff49375dc71f5ca3f6d01af4f4a0542 100644
(file)
--- a/
pycomedi/channel.pyx
+++ b/
pycomedi/channel.pyx
@@
-279,6
+279,8
@@
cdef class AnalogChannel (Channel):
super(AnalogChannel, self).__init__(**kwargs)
if range == None:
range = self.get_range(0)
+ elif isinstance(range, int):
+ range = self.get_range(range)
self.range = range
if aref == None:
flags = self.subdevice.get_flags()