From: W. Trevor King Date: Thu, 15 Mar 2012 13:54:41 +0000 (-0400) Subject: Allow keywords for Channel.get_range(). X-Git-Tag: 0.5~36 X-Git-Url: http://git.tremily.us/?p=pycomedi.git;a=commitdiff_plain;h=9d7552c9e0d89f4124a00912568b6036b0d2045a Allow keywords for Channel.get_range(). --- diff --git a/pycomedi/channel.pyx b/pycomedi/channel.pyx index 8da695c..b743731 100644 --- a/pycomedi/channel.pyx +++ b/pycomedi/channel.pyx @@ -16,6 +16,7 @@ "Wrap channel-wide Comedi functions in `Channel` and related classes" +cimport cython cimport numpy as _numpy import numpy as _numpy @@ -41,13 +42,13 @@ cdef class Channel (object): >>> d = Device('/dev/comedi0') >>> d.open() >>> s = d.get_read_subdevice() - >>> c = s.channel(0) + >>> c = s.channel(index=0) >>> c.get_maxdata() 65535L >>> c.get_n_ranges() 16 - >>> c.get_range(0) + >>> c.get_range(index=0) >>> c.find_range(constant.UNIT.volt, 0, 5) @@ -96,6 +97,7 @@ cdef class Channel (object): # doesn't support *rng. return ret + @cython.always_allow_keywords(True) def get_range(self, index): "`Range` instance for the `index`\ed range." return self._get_range(index)