From: S J. S. <swa...@gm...> - 2006-06-30 20:56:48
|
The problem is that 'dest' is not accessible from the swig wrapped code. You have to specify it as an output typmap for that to work. ttab.Translate(dest, "C3") Doesn't work because in pythong strings are immutable. So the function signature should be changed in the wrapper to be somethign like: dest=ttab.Translate("C3") Once again, this can be done by a typemap in swig (i think). Josh On 6/30/06, Geoffrey Hutchison <ge...@ge...> wrote: > > On Jun 30, 2006, at 2:45 PM, S Joshua Swamidass wrote: > > > So here is an interactive session which displays the unusability of > > OBTypeTable: I think the problem lyes in the Translate method. > > That might not be a bad idea, but the current code works just fine. > If you're looking for examples, you should take a look at the various > file format translators, e.g., src/format/tinkerformat.cpp. > > In general, the current code doesn't use exceptions. Historically, it > hasn't always been well supported by > > >>>> ttab.Translate('1','1') > > ============================== > > *** Open Babel Warning in Translate > > Cannot perform atom type translation: table cannot find requested > > types. > > False > > Yes, but "1" isn't a valid INT atom type. (Check data/types.txt if > you're curious) I'm also not sure what Python thinks about returning > something into the constant string '1'. > > How about: > ttab.Translate(dest, "C3") > > I bet that works. Check dest for the output. > > -Geoff > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |