From 02fda45efe4e55ae09a4de72b4acdac93301d424 Mon Sep 17 00:00:00 2001 From: Greg Landrum Date: Fri, 17 May 2013 05:15:17 +0200 Subject: [PATCH] fixes greglandrum/rdkit#32 --- Code/JavaWrappers/Atom.i | 6 ++++-- Code/JavaWrappers/Bond.i | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Code/JavaWrappers/Atom.i b/Code/JavaWrappers/Atom.i index 34795769e..2529fb4e4 100644 --- a/Code/JavaWrappers/Atom.i +++ b/Code/JavaWrappers/Atom.i @@ -1,5 +1,5 @@ /* -* $Id$ +* $Id: Atom.i 2519 2013-05-17 03:01:18Z glandrum $ * * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc. * All rights reserved. @@ -58,7 +58,9 @@ #endif %include -%newobject RDKit::Atom::getProp; +/* For the time being, assume all properties will be strings */ +%template(setProp) RDKit::Atom::setProp; + %extend RDKit::Atom { std::string getProp(const std::string key){ std::string res; diff --git a/Code/JavaWrappers/Bond.i b/Code/JavaWrappers/Bond.i index f1975233b..86cb2900c 100644 --- a/Code/JavaWrappers/Bond.i +++ b/Code/JavaWrappers/Bond.i @@ -1,5 +1,5 @@ /* -* $Id$ +* $Id: Bond.i 2519 2013-05-17 03:01:18Z glandrum $ * * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc. * All rights reserved. @@ -49,7 +49,16 @@ %include +/* For the time being, assume all properties will be strings */ +%template(setProp) RDKit::Bond::setProp; + %extend RDKit::Bond { + std::string getProp(const std::string key){ + std::string res; + ($self)->getProp(key, res); + return res; + } + /* Methods from MolFileStereoChem.h */ Bond::BondDir DetermineBondWedgeState(const RDKit::INT_MAP_INT &wedgeBonds, const RDKit::Conformer *conf) {