Re: [python-win32] extending com objects

2007-05-25 Thread Tim Golden
[Tim Golden] >> Presumably, then, if the original COM class exposed, >> say, a .GetGroups method which returned a list of >> groups, each of which you wanted to wrap, in this >> implementation, you'd add a .MyGetGroups method which >> called the original and wrapped the result? [Ross McKerchar] >

Re: [python-win32] extending com objects

2007-05-25 Thread Ross McKerchar
Tim Golden wrote: > This -- just in case you haven't come across the expression -- > is called monkey-patching. It's a slightly general-purpose > example of it, but it's something which is usefully easy > to do in Python. (Consequently, it's easy to abuse but...) Ah right - nice to know my dodgy h

Re: [python-win32] extending com objects

2007-05-24 Thread Tim Golden
Ross McKerchar wrote: > I've spent a good few hours bashing away and have found two ways which > appear to work with my simplistic test suite. However I'm not > particularly comfortable with either of them (the black magic I'm using > is all a bit new to me). Consequently if anyone has time to h

Re: [python-win32] extending com objects

2007-05-24 Thread Ross McKerchar
A few months ago I posted asking for some advice on ways to extend classes provided by com objects. Primarily I was keen to make a com library that I work with a lot (Notes/Domino if anyone's interested) nicer and more pythonic to use. I've spent a good few hours bashing away and have found two

Re: [python-win32] extending com objects

2006-12-21 Thread Ross McKerchar
Tim Golden wrote: > As you will realise if you've looked at my code, I'm > using a delegation model. (Sounds grand, doesn't it: > a delegation model!) Which basically means I keep > a copy of the WMI COM object inside my own class and > proxy things across where needed. > > Can't see why you could

[python-win32] extending com objects

2006-12-18 Thread Ross McKerchar
Could somebody please confirm that my objectives below are neither 1) Reinventing the wheel or 2) Attempting something that has deliberately _not_ been done by someone far wiser than me. Put simply I want to extend a com object, which, if I understand correctly is not possible in the "normal" [