alsterane / pylibnidaqmx

Automatically exported from code.google.com/p/pylibnidaqmx
Other
0 stars 0 forks source link

python 3 support #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
pylibnidaqmx doesn't support python3.  Are there any plans to do so?  I can 
assist.

Original issue reported on code.google.com by jpko...@gmail.com on 3 Jan 2014 at 11:40

GoogleCodeExporter commented 9 years ago
Hi,
I don't have near future plans regarding python3 support.
However, your assistance is most welcome. I can give you svn write access if 
you are interested.
Thanks,
Pearu

Original comment by pearu.peterson on 6 Jan 2014 at 9:54

GoogleCodeExporter commented 9 years ago
Sure, I'll take write access.  I'm a big fan of pylint, so I was going to fix 
some of the things that it complains about first.  Then I'll rewrite things in 
such a way that 2to3 can convert it automatically, and figure out how to run 
that during installation.  I can send patches for review before committing.

Original comment by jpko...@gmail.com on 6 Jan 2014 at 6:12

GoogleCodeExporter commented 9 years ago
Any progress on this one, jpkotta? :)

Original comment by richard.hoechenberger on 9 May 2014 at 1:34

GoogleCodeExporter commented 9 years ago
Sorry, I completely forgot about this.  I've just pushed the clean up stuff.  
Pylint is pretty quiet now, I have all the __future__ imports, and 2to3 
generates a pretty small diff.  There shouldn't be any user-visible changes.

I tested with a 6259 PCI DAQ on Windows.  My application, which sets analog 
outs, reads analog ins, and measures frequency, ran without issues.  

Original comment by jpko...@gmail.com on 14 May 2014 at 12:52

GoogleCodeExporter commented 9 years ago
I just ran pylibnidaqmx on python 3.4 on windows XP 32 bit.

Next to runnning 2to3, I had to make some little adjustments to the source. Is 
there a way to share this with you?

Original comment by qoqi.lei...@gmail.com on 9 Dec 2014 at 2:03

GoogleCodeExporter commented 9 years ago
Attach a patch here or email it to me.

Original comment by jpko...@gmail.com on 9 Dec 2014 at 4:39

GoogleCodeExporter commented 9 years ago
I had to make some minor changes to the code. The most significant change is 
the deprecation of namedtuples to customtuple. Functions in python3 are 
restricted to have less than 256 arguments. The namedtuple class does not work 
in that case.

In the patch file that I attached, are some changes I did before running 2to3. 
Afterwards, I had to change 1 extra line:
libnidaqmx.py:264:
new_args.append (bytes(a, encoding='utf-8'))

There might be a better way to circumvent this, in python 3, strings are 
unicode by default.

Furthermore, all _h_*_*.py files should be regenerated, or just deleted from 
the repository.

Original comment by qoqi.lei...@gmail.com on 15 Jan 2015 at 1:21

Attachments: