Re: [python-win32] Feature request: adding unicode method to CDispatch

2008-10-21 Thread Tim Roberts
Tim Roberts wrote: > > You're relying on a bunch of automatic conversions here, some of which > do conversions that you don't want. > > "j" is not a string here -- it is a Table object. The default property > of the Table object is a Range object. The default property of the > Range object is the

Re: [python-win32] Feature request: adding unicode method to CDispatch

2008-10-21 Thread Tim Roberts
Jacek Pliszka wrote: > Hi! > > I have something like this: > > wrd=Dispatch("Word.Application") > doc=wrd.Documents.Open('test.doc') > for j in doc.Tables: > s=unicode(j) > ... here I do a few searches on the date inside the table > > How can I do it without the method I mentioned ? I

Re: [python-win32] Feature request: adding unicode method to CDispatch

2008-10-21 Thread Tim Roberts
Jacek Pliszka wrote: > Would it be a problem to add __unicode__ method like this: > >def __unicode__(self): >try: >return unicode(self.__call__()) >except pythoncom.com_error, details: >if details[0] not in ERRORS_BAD_CONTEXT: >

[python-win32] Feature request: adding unicode method to CDispatch

2008-10-21 Thread Jacek Pliszka
Hi! Would it be a problem to add __unicode__ method like this: def __unicode__(self): try: return unicode(self.__call__()) except pythoncom.com_error, details: if details[0] not in ERRORS_BAD_CONTEXT: raise