building Tegaki on Mac OS X pt. I

14 views
Skip to first unread message

tee.aye.w

unread,
Nov 30, 2009, 11:05:01 AM11/30/09
to Tegaki Handwriting Recognition Project
Hello,

I'm trying to get the Tegaki build working on Mac OS X but I'm running
into trouble. I probably missed a step on the way, but I run the
script 'sudo python setup.py install' and it runs without reporting
errors, but when I later try the test script 'runtests.py' it fails
with the following errors:

............F...E............................E.......
======================================================================
ERROR: testValidate (test_character.CharacterCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/weisbach/Projects/tegaki/src/hwr/tegaki-python/tests/
test_character.py", line 637, in testValidate
self.assertTrue(CharacterCollection.validate(buf))
File "/Library/Python/2.6/site-packages/tegaki/character.py", line
617, in validate
except etree.XMLSyntaxError:
NameError: global name 'etree' is not defined

======================================================================
ERROR: testValidate (test_character.CharacterTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/weisbach/Projects/tegaki/src/hwr/tegaki-python/tests/
test_character.py", line 590, in testValidate
self.assertTrue(Character.validate(buf))
File "/Library/Python/2.6/site-packages/tegaki/character.py", line
617, in validate
except etree.XMLSyntaxError:
NameError: global name 'etree' is not defined

======================================================================
FAIL: testFromCharDirRecursive
(test_character.CharacterCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/weisbach/Projects/tegaki/src/hwr/tegaki-python/tests/
test_character.py", line 738, in testFromCharDirRecursive
self.assertEquals(charcol.get_set_list(), ["防", "三", "一", "二"])
AssertionError: ['\xe9\x98\xb2', '\xe4\xb8\x80', '\xe4\xb8\x89',
'\xe4\xba\x8c'] != ['\xe9\x98\xb2', '\xe4\xb8\x89', '\xe4\xb8\x80',
'\xe4\xba\x8c']

----------------------------------------------------------------------
Ran 53 tests in 0.553s

Is this a sign the build isn't working properly?

Mathieu Blondel

unread,
Nov 30, 2009, 12:05:05 PM11/30/09
to tegak...@googlegroups.com
On Tue, Dec 1, 2009 at 1:05 AM, tee.aye.w <tee....@gmail.com> wrote:
> ............F...E............................E.......
> ======================================================================
> ERROR: testValidate (test_character.CharacterCollectionTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/Users/weisbach/Projects/tegaki/src/hwr/tegaki-python/tests/
> test_character.py", line 637, in testValidate
>    self.assertTrue(CharacterCollection.validate(buf))
>  File "/Library/Python/2.6/site-packages/tegaki/character.py", line
> 617, in validate
>    except etree.XMLSyntaxError:
> NameError: global name 'etree' is not defined
>
> ======================================================================
> ERROR: testValidate (test_character.CharacterTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/Users/weisbach/Projects/tegaki/src/hwr/tegaki-python/tests/
> test_character.py", line 590, in testValidate
>    self.assertTrue(Character.validate(buf))
>  File "/Library/Python/2.6/site-packages/tegaki/character.py", line
> 617, in validate
>    except etree.XMLSyntaxError:
> NameError: global name 'etree' is not defined

You're missing py26-lxml from macports. We use this library for XML
validation. It's optional but it's recommended if you're using tegaki
on the server side (to check that the XML passed to character objects
is valid)

>
> ======================================================================
> FAIL: testFromCharDirRecursive
> (test_character.CharacterCollectionTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/Users/weisbach/Projects/tegaki/src/hwr/tegaki-python/tests/
> test_character.py", line 738, in testFromCharDirRecursive
>    self.assertEquals(charcol.get_set_list(), ["防", "三", "一", "二"])
> AssertionError: ['\xe9\x98\xb2', '\xe4\xb8\x80', '\xe4\xb8\x89',
> '\xe4\xba\x8c'] != ['\xe9\x98\xb2', '\xe4\xb8\x89', '\xe4\xb8\x80',
> '\xe4\xba\x8c']

If you look closely, the two lists are the same except that the 2nd
and the 3rd elements are swapped. My guess is that Mac OS X traverses
directories differently than Linux (where this test passes). So this
needs to be fixed but it's not big deal.

Mathieu
Reply all
Reply to author
Forward
0 new messages