[python-win32] [Fwd: Re: Running the COM MakePy Utility from python]
vernondcole at gmail.com
Thu Aug 27 18:34:42 CEST 2009
( I read your new source code before commenting ... NICE PROJECT ! <insert
back patting here> )
The constants you are using here are hard-coded into adodbapi, therefore
has the same value as adTinyInt in your dbe_globals.py
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.
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.
On Thu, Aug 27, 2009 at 5:51 AM, Grant Paton-Simpson <grant at p-s.co.nz>wrote:
> Hi Harald,
> I managed to make a file containing everything I needed. NB the command
> is makepy.py not makepy. There was, however, an issue with genpy.py
> asserting there had to be a self.file.encoding even though I couldn't
> see where that was set. I temporarily commented that assert out. File
> creation then worked. I then took out the small portion of the script I
> needed - all the data type constants - and put those in my own module.
> For the benefit of others, the reason you don't have to specify the
> library e.g. ActiveX 2.8, is that you will be prompted for it via a pop
> up GUI.
> All the best, Grant
> Massa, Harald Armin wrote:
> > Grant,
> > that is possible. Just read the makepy.py script within
> > win32com.client, and you will find that someway down main() there is
> > ---------
> > GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel,
> > bForDemand = bForDemand, bBuildHidden = hiddenSpec)
> > ---------
> > which does this.
> > BUT, for "static" usage of makepy-COM-Mappings I suggest to make
> > makepy output it's results in a named file
> > makepy -o ADO28.py
> > and furtheron import that ADO28 file to access the variables. That
> > does also work with Excel and Word, and I am used to
> > import ExcelXX as Excel
> > ec=Excel.constants
> > and further on us ec.* for excel constants.
> > Best wishes,
> > HArald
> > On Thu, Aug 27, 2009 at 2:51 AM, Grant Paton-Simpson <grant at p-s.co.nz
> > <mailto:grant at p-s.co.nz>> wrote:
> > Hi,
> > Basically I want to have an installation package automatically run
> > COM MakePy utility for the ADO 2.8 library. I believe I need to do
> > this
> > so that constants like win32com.client.constants.adTinyInt will be
> > available when my application (http://www.sofastatistics.com)
> > connects to
> > MS Access and MS SQL Server databases.
> > Ideally I would have a line doing something like this:
> > win32com.runmakepy("Microsoft ActiveX Data Objects 2.8 Library
> > Is it possible to do this programmatically?
> > All the best, Grant
> > _______________________________________________
> > python-win32 mailing list
> > python-win32 at python.org <mailto:python-win32 at python.org>
> > http://mail.python.org/mailman/listinfo/python-win32
> > --
> > GHUM Harald Massa
> > persuadere et programmare
> > Harald Armin Massa
> > Spielberger Straße 49
> > 70435 Stuttgart
> > 0173/9409607
> > no fx, no carrier pigeon
> > -
> > LASIK good, steroids bad?
> python-win32 mailing list
> python-win32 at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the python-win32