Grant:<br>
<br>
( I read your new source code before commenting ... NICE PROJECT ! <insert back patting here> )<br>
<br>
The constants you are using here are hard-coded into adodbapi, therefore adodbapi.adTinyInt <br>
has the same value as adTinyInt in your dbe_globals.py<br>
and win32com.client.constants.adTinyInt<br>
<br>
I assume that those values are not likely to change -- since they end
up in a lot of static compiled code -- and a few extra hard-coded
definitions of them laying around in Python source modules should not
be a source of difficulty. IMHO your recent solution is correct.<br>
<br>My goal is to get adodbapi to the point where it can be pretty much a drop-in replacement for pgdb and MySQLdb in most cases, so that programmers can use it to start moving code like yours into newer and/or weirder environments (i.e. IronPython and Python 3). I will be referring to your work as I add postgresql tests to the adodbapi suite.<br>
--<br>
Vernon Cole<br>
<br><br><div class="gmail_quote">On Thu, Aug 27, 2009 at 5:51 AM, Grant Paton-Simpson <span dir="ltr"><<a href="mailto:grant@p-s.co.nz">grant@p-s.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Harald,<br>
<br>
I managed to make a file containing everything I needed. NB the command<br>
is makepy.py not makepy. There was, however, an issue with genpy.py<br>
asserting there had to be a self.file.encoding even though I couldn't<br>
see where that was set. I temporarily commented that assert out. File<br>
creation then worked. I then took out the small portion of the script I<br>
needed - all the data type constants - and put those in my own module. Success!<br>
<br>
For the benefit of others, the reason you don't have to specify the<br>
library e.g. ActiveX 2.8, is that you will be prompted for it via a pop<br>
up GUI.<br>
<br>
<br>
All the best, Grant<br>
<br>
<br>
Massa, Harald Armin wrote:<br>
> Grant,<br>
><br>
> that is possible. Just read the makepy.py script within<br>
> win32com.client, and you will find that someway down main() there is<br>
><br>
> ---------<br>
> GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel,<br>
> bForDemand = bForDemand, bBuildHidden = hiddenSpec)<br>
> ---------<br>
><br>
> which does this.<br>
><br>
> BUT, for "static" usage of makepy-COM-Mappings I suggest to make<br>
> makepy output it's results in a named file<br>
><br>
> makepy -o ADO28.py<br>
><br>
> and furtheron import that ADO28 file to access the variables. That<br>
> does also work with Excel and Word, and I am used to<br>
><br>
> import ExcelXX as Excel<br>
> ec=Excel.constants<br>
><br>
> and further on us ec.* for excel constants.<br>
><br>
> Best wishes,<br>
><br>
> HArald<div><div></div><div class="h5"><br>
><br>
> On Thu, Aug 27, 2009 at 2:51 AM, Grant Paton-Simpson <<a href="mailto:grant@p-s.co.nz" target="_blank">grant@p-s.co.nz</a><br>
> <mailto:<a href="mailto:grant@p-s.co.nz" target="_blank">grant@p-s.co.nz</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> Basically I want to have an installation package automatically run the<br>
> COM MakePy utility for the ADO 2.8 library. I believe I need to do<br>
> this<br>
> so that constants like win32com.client.constants.adTinyInt will be<br>
> available when my application (<a href="http://www.sofastatistics.com" target="_blank">http://www.sofastatistics.com</a>)<br>
> connects to<br>
> MS Access and MS SQL Server databases.<br>
><br>
> Ideally I would have a line doing something like this:<br>
><br>
> win32com.runmakepy("Microsoft ActiveX Data Objects 2.8 Library (2.8)")<br>
><br>
> Is it possible to do this programmatically?<br>
><br>
><br>
> All the best, Grant<br>
> _______________________________________________<br>
> python-win32 mailing list<br></div></div>
> <a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a> <mailto:<a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a>><div class="im"><br>
> <a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
><br>
><br>
><br>
><br></div>
> --<br>
> GHUM Harald Massa<br>
> persuadere et programmare<br>
> Harald Armin Massa<br>
> Spielberger Straße 49<br>
> 70435 Stuttgart<br>
> 0173/9409607<br>
> no fx, no carrier pigeon<br>
> -<br>
> LASIK good, steroids bad?<div><div></div><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
</div></div></blockquote></div><br>