From: Stas Z <sta...@gm...> - 2005-09-23 13:06:12
|
On 9/22/05, Richard Jones <jo...@gm...> wrote: > > I suspect because gmailfs interacts with the internal message threads > > rather then > > through an API, it gets into trouble because there are changes to these= internal > > class attributes. [....] > You are quite correct I shouldn't be messing with the internal class > attributes, however I don't think this is the core problem here > (although it doesn't help). > > If you look at the GmailSearchResult initialisation method below: [...] > except IndexError: > print "Empty account" [...] > Based on the error message "Empty Account" you seem to be assuming > that threadsInfo[0] will be an illegal index only when the account is > empty. In fact there appears to be a much more common reason for > threadsInfo to be empty, this seems to occur (based on my limited > testing) when the query returns no results. Your right the message is wrong it should say "Empty thread" [...] > attributes, I couldn't find an API supported way of directly indexing > particular thread and message numbers, please tell me if I'm missing > something). Well I guess if you using libgmail in such a way as you do in gmailfs your better of with a abstraction layer that can function as a interface to libgmail. My proposal to you as your a "libgmail-poweruser" is this; If you describe which methods you need then we will provide a object that act as a interface between gmailfs and libgmail. We will maintain this class so that any change we make to libgmail will also be changed in the interface class. We will put it into a module of it's own so that it doesn't affect the 'nor= mal' libgmail usage. For example: You want to know how many messages there are in a thread. So you want to do something like: from FsInter import FsInter # This is the abstraction class ga is FsInter.GMAccount("name","pass") ga.login() thread =3D ga.getMessages....... .... def getinodemsg(): ...... ...... return thread.NumberOf Messages() Or something like that. Then you don't have to care about our changes :-) We will make sure that the abstraction class gets to the internals in a proper way. Stas -- A nation that continues year after year to spend more money on military def= ense than on programs of social uplift is approaching spiritual doom. Martin Luther King, Jr. |