Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Are makepy-generated COM wrapper classes distributable?

Reply
Thread Tools

Are makepy-generated COM wrapper classes distributable?

 
 
gundlach
Guest
Posts: n/a
 
      08-04-2008
Hi!

I've just written a Python speech-recognition module (http://
pyspeech.googlecode.com). It provides a clean and simple interface to
the Microsoft Speech SDK using COM wrapper classes generated by
PythonWin's MakePY utility.

Once this is a mature module, I'd like to make it as useful as
possible to the community, so I'd like to make installation as simple
as possible. Currently, to get speech.py to work, you must first:

* install the Microsoft Speech SDK onto a Windows box, and
* possibly install PythonWin, and then
* run PythonWin's MakePY utility to generate modules into the gen_py
dir.

I'd like to remove the MakePY steps, so that as long as a user has run
the SDK installer, she can install the 'speech' package and be ready
to use it. Can I somehow bundle the generated modules into my
setuptools package so that the wrappers are installed at the same
time? (If so, how -- just copy them into the package directory?) Or
are the wrappers targeted to my machine or installation, so that
everyone is forced to go through this?

Thanks for any pointers,
Michael
 
Reply With Quote
 
 
 
 
gundlach
Guest
Posts: n/a
 
      08-05-2008
On Aug 4, 2:24*am, gundlach <gundl...@gmail.com> wrote:
> Can I somehow bundle the generated modules into my
> setuptools package so that the wrappers are installed at the same
> time? *(If so, how -- just copy them into the package directory?) *Or
> are the wrappers targeted to my machine or installation, so that
> everyone is forced to go through this?


I answered my own question, and it's even better than I had hoped
for. For posterity: running

python $PYTHONDIR/lib/site-packages/win32com/client/makepy.py -i

and selecting your COM class of choice will output the Python code to
stick into your module which guarantees that the necessary wrapper
classes exist in the cache. If they don't, they're created at
runtime. If they do, it's a no-op.

So there's no need for me to tell users to run MakePY, nor for me to
copy the generated classes into my project somehow. Great!

Michael
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
primitive wrapper classes mike7411@gmail.com Java 21 09-24-2007 12:13 PM
Wrapper classes are Immutable but you use them to make a function parameter a reference? marcwentink@hotmail.com Java 11 12-04-2006 03:55 PM
function pointers and wrapper classes mancomb C++ 5 09-20-2006 07:05 PM
Classes within classes David ASP .Net 2 07-22-2005 07:13 PM
wrapper classes question.. vegetax Python 0 02-09-2005 05:27 PM



Advertisments