From: W. Trevor King Date: Mon, 19 Mar 2012 16:41:29 +0000 (-0400) Subject: Actually listen to the --subdevice option in the insn.py demo. X-Git-Tag: 0.5~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c81a4edb26723253ad768bd3d0cf8ff407293fb4;p=pycomedi.git Actually listen to the --subdevice option in the insn.py demo. --- diff --git a/doc/demo/insn.py b/doc/demo/insn.py index ad77e5d..9fc1001 100755 --- a/doc/demo/insn.py +++ b/doc/demo/insn.py @@ -55,7 +55,10 @@ if __name__ == '__main__': device = _Device(filename=args.filename) device.open() - subdevice = device.find_subdevice_by_type(_constant.SUBDEVICE_TYPE.ai) + if args.subdevice is None: + subdevice = device.find_subdevice_by_type(_constant.SUBDEVICE_TYPE.ai) + else: + subdevice = device.subdevice(args.subdevice) insns = [subdevice.insn(), subdevice.insn(), subdevice.insn()] insns[0].insn = insns[2].insn = _constant.INSN.gtod