---------- Forwarded message ----------
From: Chris Morley <[email protected]>
Date: 16 August 2010 14:28
Subject: Re: .dll loading on Windows and Python
To: Noel O'Boyle <[email protected]>


Noel

This indeed is a "feature".

OBConversion::LoadFormatFiles(), which finds obf files, is called from
the OBConversion constructor. The GUI makes a dummy OBConversion
object for this purpose.

Years ago it used to be different, I think by having some sort of
static object which was initialised at startup. But somebody said it
didn't work for them and I reluctantly changed it to the present
inelegant method.

Chris

On 16/08/2010 14:16, Noel O'Boyle wrote:
>
> Hi all,
>
> On Windows (7) using Python, I've just noticed that at least some
> plugins cannot be found using FindType until an instance of an
> OBConversion() is created.
>
> Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit
> (Intel)] on win32
>>>>
>>>> import openbabel as ob
>>>> print ob.OBForceField.FindType("MMFF94")         # Cannot find
>
> None
>>>>
>>>> print ob.OBFormat.FindType("smi")
>
> None
>
>>>> ob.OBConversion()
>
> <openbabel.OBConversion; proxy of<Swig Object of type
> 'OpenBabel::OBConversion*' at 0x0035F380>  >
>
>>>> print ob.OBForceField.FindType("MMFF94")        # *Can* find
>
> <openbabel.OBForceField; proxy of<Swig Object of type
> 'OpenBabel::OBForceField*' at 0x0035F260>  >
>>>>
>>>> print ob.OBFormat.FindType("smi")
>
> <openbabel.OBFormat; proxy of<Swig Object of type
> 'OpenBabel::OBFormat *' at 0x0049F350>  >
>
> Weird, huh? Any idea why this is? I don't think it's anything new - I
> probably just never noticed before because pybel creates an instance
> of OBConversion right at the start of the file. So anyone that imports
> pybel wouldn't notice this.
>
> - Noel
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.851 / Virus Database: 271.1.1/3074 - Release Date: 08/15/10 
> 19:35:00
>

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to