GNOME Bugzilla – Bug 561452
[pending] Factor out included "louis" C extension.
Last modified: 2009-11-09 21:35:36 UTC
We are currently in the process of putting the liblouis python bindings upstream with liblouis. They are ctype bindings, you could see them at: http://code.google.com/p/liblouis/source/browse/#svn/branches/python There are some tricky stuff that needs to be moved around, specifically the table discovery and listing functionality, this should be moved into Orca-proper.
Created attachment 126264 [details] [review] patch This patch removes the included bindings, puts some of the added functionality we had into braille.py, this includes translatable strings. It works with the "python" branch in the liblouis SVN repo. I plan to get the python bindings merged into liblouis trunk very soon. If we could get a liblouis release out soon too, I think these changes should be considered.
(In reply to comment #1) > I plan to get the python bindings merged into liblouis trunk very soon. If we > could get a liblouis release out soon too, I think these changes should be > considered. Sounds good to me. The thing we risk is that people using the old liblouis stuff will end up not having liblouis support with Orca, but I think it might be safe to tell them to upgrade once your new release is out. Thanks!
In looking at this some more, it turns out the liblouis Python bindings depend upon the presence of the Python ctypes module. The ctypes module has limited availability (e.g., it's not in Python 2.4 for example), so this might be a risky dependency.
(In reply to comment #3) > In looking at this some more, it turns out the liblouis Python bindings depend > upon the presence of the Python ctypes module. The ctypes module has limited > availability (e.g., it's not in Python 2.4 for example), so this might be a > risky dependency. As an FYI, I believe OpenSolaris 2009.06 will include ctypes for 2.4. It's in OpenSolaris starting with build 110. The package is called SUNWpython24-ctypes. So, I could potentially update the spec-files-extra spec-file for liblouis to include a dependency on SUNWpython24-ctypes (http://pkgbuild.sourceforge.net/spec-files-extra/). In addition, since the liblouis Python module is called 'louis' and the Orca Python module for liblouis is also called 'louis', we might need to make sure the code moving forward can detect the difference if *both* are installed on the machine and then use the right one.
Created attachment 135356 [details] [review] Updated patch This is an updated patch for the current source base, which has migrated to the BrlTTY python bindings. It's not providing the desired behavior for me on OpenSolaris, but it might be that I'm building liblouis 1.6.0 improperly. The patch includes this debugging statement (to be removed before checking the ultimate patch in): print "CONTRACTION: mode=%d in='%s' out='%s'" % (mode, line, contracted) What I'm noticing is that very little comes back to us in terms of the contracted line when using the US English Grade 2 braille (I know enough to recognize that it ain't Grade 2). Eitan - does liblouis come with any tests to see if it is working properly?
(In reply to comment #5) > Eitan - does liblouis come with any tests to see if it is working properly? Eitan - ping? :-)
What output do you get when you run "python python/louis/__init__.py" from the liblouis source tree? Did you configure with --enable-ucs4?
I just tried the updated patch, and it seems to work well. I guess the next stage is a opensolaris vm? Let me know if --enable-ucs4 is helpful.
(In reply to comment #8) > I just tried the updated patch, and it seems to work well. I guess the next > stage is a opensolaris vm? > > Let me know if --enable-ucs4 is helpful. I'll give it a shot. We've been building with --disable-ucs4 because of this comment: http://bugzilla.gnome.org/show_bug.cgi?id=354470#c23
Hot off the presses when built with --enable-ucs4: wwalker@opensolaris:~/work/liblouis-1.6.2$ python python/louis/__init__.py 1.6.2 (u',hello _w6', [0, 0, 1, 2, 3, 4, 5, 6, 6, 11], [1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 9], 6) What does it mean? Is it the Da Vinci Code?
(In reply to comment #8) > I just tried the updated patch, and it seems to work well. I guess the next > stage is a opensolaris vm? > > Let me know if --enable-ucs4 is helpful. Seemed to do the trick. Out of curiosity, what changed to make us need to switch from --disable-ucs4 to --enable-ucs4? Was is something in liblouis or do you think OpenSolaris changed?
Created attachment 136737 [details] [review] Patch committed This patch has been committed to master. I also updated the OpenSolaris SFEliblouis.spec file to build/install liblouis 1.6.2 and its "louis" python module: http://pkgbuild.sourceforge.net/spec-files-extra/
(In reply to comment #11) > > Seemed to do the trick. Out of curiosity, what changed to make us need to > switch from --disable-ucs4 to --enable-ucs4? Was is something in liblouis or > do you think OpenSolaris changed? > It seems like OpenSolaris is now building Python with 4 byte wide unicode characters as opposed to 2, which is the default. Most Linux distros use 4 byte wide unicode in Python too.
Marking this as pending. The big issue is this: liblouis called their module 'louis', which is to be expected. This conflicts with the 'louis' module provided by Orca. The net result is that if someone installs liblouis' 'louis' module, it will break Orca versions 2.27.3 and earlier. I believe this is because those versions of Orca will end up picking up the liblouis module instead of the Orca module.