The old method only worked out of the box if you were running Python
2.1 on a 586. I imagine that is too small a slice of current users to
be worth hard coding ;).
This avoids:
Traceback (most recent call last):
...
File ".../mmap.py", line 96, in prepare_cmd
C.scan_begin_arg = 1e9/freq
...
TypeError: in method 'comedi_cmd_struct_scan_begin_arg_set',
argument 2 of type 'unsigned int'
With the previous implementation, `mmap` was importing the demo
script, not the standard `mmap` library module. From the docs [1]:
The directory containing the script being run is placed at the
beginning of the search path, ahead of the standard library
path. This means that scripts in that directory will be loaded
instead of modules of the same name in the library directory.
I'm not sure when this changed in Python, since the demo script
presumably worked with an earlier version.
[1]: http://docs.python.org/tutorial/modules.html#the-module-search-path
This catches it up for the folowing commits to the comedi repository:
commit 311e9c540217d60bdf56a1dba9eafe474fd3b218
Author: Bernd Porr <Bernd.Porr@f2s.com>
Date: Sun Jan 13 23:07:02 2008 +0000
Added a proper PWM subdevice for comedi.
commit 8092ed57ff38e1fcaf75a7e0bf3b8c4f5372f3d7
Author: Frank Mori Hess <fmhess@speakeasy.net>
Date: Sat Jan 31 22:13:09 2004 +0000
serial dio (SCXI) support from Caleb Tennis
This catches the Python demos up to:
commit 003b9ec501
Author: Ian Abbott <abbotti@mev.co.uk>
Date: Mon Nov 8 11:01:42 2010 +0000
Add chanlist_len parameter to comedi_get_cmd_generic_timed.