>> I agree that version checking outside would be nicer. I tried to hack
>> the comtypes.client._generate module and the codegenerator to implement this,
>> but there is one place where an outside version check does not work. For
>> example, the InternetExplorer typelib generated module contains this
>> statement:
>> import comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
>> which imports the stdole2.tlb typelib wrapper code. So this import is not
>> done with some code in the _generate module and cannot be checked from there.
>
> Good point. So adding the code to the generated module makes the most
> sense. So I guess you'll remove the code outside of the module, then.
Here's the next idea that I have for the version checking: Version check inside
the generated modules, but using code outside:
So, inside the generated module:
'''
from comtypes import check_wrapper_version
check_wrapper_version('42')
'''
comtypes.check_wrapper_version() would compare against the code generator
version,
and in the simplest case raise an ImportError("version mismatch"). In a more
sophisticated implementation it could regenerate and reload the module.
But I have no time to implement this now.
--
Thanks,
Thomas
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/comtypes-users