Jean-Claude Wippler wrote:


MK has never supported spaces in the description string.

By support do you mean unintended consequences? I've noticed that it seems to work just fine on windows, at least through the python wrapper:


import metakit
db = metakit.storage()

vw = db.getas("test[first field, second field]")
print vw.structure()
# [Property('S', 'first field'), Property('S', ' second field')]

property = metakit.property("S", " [EMAIL PROTECTED]&*()~`,./<>?:\";'")
print property
#Property('S',
# ' [EMAIL PROTECTED]&*()~`,./<>?:";'')


vw.addproperty(property)
print vw.structure()
#[Property('S', 'first field'), Property('S', ' second field'),
# Property('S', ' [EMAIL PROTECTED]&*()~`,./<>?:";'')]


This has actually been quite useful for KitViewer in that I can take *any* header description from a CSV file as long as I strip out commas. [As a side note, you cannot use the standard (value = row.abcde 123) technique to get values, you have to use (getattr(row, "abcde 123")]

Now from the python side, a more critical error is that sometimes the following happens:

vw = db.getas("bad_table[A:S,B:S,A:I,B:I]")
vw.structure()
==> SystemError: error return without exception set

vw.append(("this", "is", 0, 0))
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
SystemError: NULL result without error in PyObject_Call

I think after the first failure to db.getas no other error is caught, I'll look at the source code to see if an exception can be set properly.

I've even had the interpreter crash on me. My solution was to write a wrapper around db.getas(...) that parses the command for errors like this and returns a reasonable error message.

--
Brian Kelley                                  [EMAIL PROTECTED]
Whitehead Institute for Biomedical Research   617 258-6191


_______________________________________________ metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit

Reply via email to