You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(42) |
Jul
(1) |
Aug
(1) |
Sep
(74) |
Oct
(1) |
Nov
(3) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Andrew L. <one...@gm...> - 2005-09-18 21:03:47
|
Hm, I was wondering if you'd made the changes necessary to make it run in anything but 2.4. All of my machines have 2.4, so I've almost forgotten what are 2.4 only features; of course, I'd assume that for public consumption you guys want to stay compatible with 2.3 at the least. The change you described can probably be done more easily by just adding [] around the genexp. That should work in 2.3; I forget when listcomps were added, but IIRC it should work in 2.2 as well. Also, where can I find the CVS version you refer to? I followed sourceforge's directions for anonymous checkout of libgmail CVS, and got (AFAICT) the same version as before. Andrew On 9/18/05, Waseem S. Daher <wd...@mi...> wrote: > Stas- >=20 > Thanks for all your hard work! > Right now when I run the latest CVS version, I get the following error: >=20 > wdaher@zygorthian-space-raiders:~/Projects/libgmail$ python libgmail.py > File "libgmail.py", line 93 > data =3D '\n'.join(x for x in lines if x and x[0] in ['D', ')', ',', > ']']) > ^ > SyntaxError: invalid syntax >=20 > wdaher@zygorthian-space-raiders:~/Projects/libgmail$ python -V > Python 2.3.3 >=20 >=20 >=20 > To try to fix this, I made the following change: > - data =3D '\n'.join(x for x in lines if x and x[0] in ['D', ')', ',', > ']']) > + potential_data =3D [] > + for x in lines: > + if x and x[0] in ['D', ')', ',', ']']: > + potential_data.append(x) > + data =3D '\n'.join(potential_data) >=20 > I have yet to check this into CVS though, because it's not totally doing > the right thing -- when I run libgmail on its own after this fix, > getQuota() doesn't work. >=20 > I'll try to look into this more this evening. >=20 > Also, I uncommented a 'deal with multiline notes fields in contacts', > and that test does not yet pass for some reason. I'll try to investigate > further. I /have/ checked in this version of testlibgmail.py though. >=20 > In any case, thanks for all your hard work! >=20 > - W >=20 >=20 > On Sun, 2005-09-18 at 21:05 +0200, Stas Z wrote: > > Gentleman, > > > > After spending the better part of my free Sunday hacking on the page pa= rser > > in libgmail and ending up refactoring a major part of libgmail, I'm ple= ased to > > inform you that the work is done. > > The new libgmail with the Andrew-parser is currently available in CVS. > > > > Just as a reminder of why this is done. > > Andrew reported a serious security bug in the page parser we used in li= bgmail. > > He already had created a different designed parser which doesn't have > > these potential > > bugs. Because the parser used in libgmail also had other problems > > related to the frequent > > changes in the javascript by Gmail, we decided to replace the parser > > in libgmail. > > > > I've done the following tests: > > testlibgmail.py > > the test code in libgmail.py > > the sendmessage.py demo > > running libgmail in a python shell > > > > Of course it passed all these tests :-) > > > > I want to release it tomorrow, but I would really like that somebody > > else test this > > before that. > > > > Cheers, > > Stas > > >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your ver= y > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Gmailagent-devel mailing list > Gma...@li... > https://lists.sourceforge.net/lists/listinfo/gmailagent-devel > |
|
From: Waseem S. D. <wd...@MI...> - 2005-09-18 20:52:37
|
Stas-
Thanks for all your hard work!
Right now when I run the latest CVS version, I get the following error:
wdaher@zygorthian-space-raiders:~/Projects/libgmail$ python libgmail.py
File "libgmail.py", line 93
data = '\n'.join(x for x in lines if x and x[0] in ['D', ')', ',',
']'])
^
SyntaxError: invalid syntax
wdaher@zygorthian-space-raiders:~/Projects/libgmail$ python -V
Python 2.3.3
To try to fix this, I made the following change:
- data = '\n'.join(x for x in lines if x and x[0] in ['D', ')', ',',
']'])
+ potential_data = []
+ for x in lines:
+ if x and x[0] in ['D', ')', ',', ']']:
+ potential_data.append(x)
+ data = '\n'.join(potential_data)
I have yet to check this into CVS though, because it's not totally doing
the right thing -- when I run libgmail on its own after this fix,
getQuota() doesn't work.
I'll try to look into this more this evening.
Also, I uncommented a 'deal with multiline notes fields in contacts',
and that test does not yet pass for some reason. I'll try to investigate
further. I /have/ checked in this version of testlibgmail.py though.
In any case, thanks for all your hard work!
- W
On Sun, 2005-09-18 at 21:05 +0200, Stas Z wrote:
> Gentleman,
>
> After spending the better part of my free Sunday hacking on the page parser
> in libgmail and ending up refactoring a major part of libgmail, I'm pleased to
> inform you that the work is done.
> The new libgmail with the Andrew-parser is currently available in CVS.
>
> Just as a reminder of why this is done.
> Andrew reported a serious security bug in the page parser we used in libgmail.
> He already had created a different designed parser which doesn't have
> these potential
> bugs. Because the parser used in libgmail also had other problems
> related to the frequent
> changes in the javascript by Gmail, we decided to replace the parser
> in libgmail.
>
> I've done the following tests:
> testlibgmail.py
> the test code in libgmail.py
> the sendmessage.py demo
> running libgmail in a python shell
>
> Of course it passed all these tests :-)
>
> I want to release it tomorrow, but I would really like that somebody
> else test this
> before that.
>
> Cheers,
> Stas
>
|
|
From: Stas Z <sta...@gm...> - 2005-09-18 19:05:54
|
Gentleman, After spending the better part of my free Sunday hacking on the page parser in libgmail and ending up refactoring a major part of libgmail, I'm pleased= to inform you that the work is done. The new libgmail with the Andrew-parser is currently available in CVS. Just as a reminder of why this is done. Andrew reported a serious security bug in the page parser we used in libgma= il. He already had created a different designed parser which doesn't have these potential bugs. Because the parser used in libgmail also had other problems related to the frequent changes in the javascript by Gmail, we decided to replace the parser in libgmail. I've done the following tests: testlibgmail.py the test code in libgmail.py the sendmessage.py demo running libgmail in a python shell Of course it passed all these tests :-) I want to release it tomorrow, but I would really like that somebody else test this before that. Cheers, Stas --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-18 15:43:50
|
On 9/18/05, Andrew Lin <one...@gm...> wrote: > ...oops. This is what I get for not reading the entire thread before > posting. :-P The problem is not your parser :-) It's the way libgmail is 'created' around the text parser, it has a very high hackerish level. Your parser return a consistant dictionary, at least how I implemented it ;= -) The rest of libgmail is made to work with the old inconsistant dictionary. That's not how it should be, it makes debugging very hard :-( I hope this makes some sence, I'm in a hurry. The refactoring of libgmail is something Waseem and I had talked about befo= re and now with your parser it's about time to refactor libgmail. Now I'm gonna eat with my family, I will continue tonight. (I'm in GMT + 2.= 00) Cheers, Stas --=20 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. |
|
From: Andrew L. <one...@gm...> - 2005-09-18 15:27:42
|
...oops. This is what I get for not reading the entire thread before posting. :-P On 9/18/05, Andrew Lin <one...@gm...> wrote: > Hi Stas, >=20 > Just to note: while I'm fairly sure my parser works okay to download > contacts, I've never tried to download any of the other things > libgmail can handle (messages, etc.) with it. So I would test those > rather carefully. :-) >=20 > Andrew >=20 >=20 > On 9/18/05, Stas Z <sta...@gm...> wrote: > > Yet another update :-) > > > > I'm halfway refactoring libgmail. > > The reason why I don't commit it to CVS is that I'm not convinced that > > the end result > > would be good enough to replace the parsing as we have it now in libgma= il. > > > > I making progress, slow but steady :-) > > > > I hope the end result would be a cleaner and saver libgmail. > > > > Stas > > > > On 9/18/05, Stas Z <sta...@gm...> wrote: > > > On 9/18/05, Stas Z <sta...@gm...> wrote: > > > > Just a quick update. > > > > > > > > I'm currently replacing the libgmail page parser for the parser fro= m Andrew. > > > > This will resolve two issues. > > > Bummer, contacts work perfectly with the new parser, but it fails to = parse other > > > pages. (inbox, sent etc) > > > > > > I'm off for a few hours, but return in 4 hours from now. > > > If anyone wants to get a shot at this, please contact me to avoid doi= ng the same > > > thing twice. > > > > > > Stas > > > > > > -- > > > A nation that continues year after year to spend more money on milita= ry defense > > > than on programs of social uplift is approaching spiritual doom. > > > Martin Luther King, Jr. > > > > > > > > > -- > > A nation that continues year after year to spend more money on military= defense > > than on programs of social uplift is approaching spiritual doom. > > Martin Luther King, Jr. > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: > > Tame your development challenges with Apache's Geronimo App Server. > > Download it for free - -and be entered to win a 42" plasma tv or your v= ery > > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.p= hp > > _______________________________________________ > > Gmailagent-devel mailing list > > Gma...@li... > > https://lists.sourceforge.net/lists/listinfo/gmailagent-devel > > > |
|
From: Andrew L. <one...@gm...> - 2005-09-18 15:26:57
|
Hi Stas, Just to note: while I'm fairly sure my parser works okay to download contacts, I've never tried to download any of the other things libgmail can handle (messages, etc.) with it. So I would test those rather carefully. :-) Andrew On 9/18/05, Stas Z <sta...@gm...> wrote: > Yet another update :-) >=20 > I'm halfway refactoring libgmail. > The reason why I don't commit it to CVS is that I'm not convinced that > the end result > would be good enough to replace the parsing as we have it now in libgmail= . >=20 > I making progress, slow but steady :-) >=20 > I hope the end result would be a cleaner and saver libgmail. >=20 > Stas >=20 > On 9/18/05, Stas Z <sta...@gm...> wrote: > > On 9/18/05, Stas Z <sta...@gm...> wrote: > > > Just a quick update. > > > > > > I'm currently replacing the libgmail page parser for the parser from = Andrew. > > > This will resolve two issues. > > Bummer, contacts work perfectly with the new parser, but it fails to pa= rse other > > pages. (inbox, sent etc) > > > > I'm off for a few hours, but return in 4 hours from now. > > If anyone wants to get a shot at this, please contact me to avoid doing= the same > > thing twice. > > > > Stas > > > > -- > > A nation that continues year after year to spend more money on military= defense > > than on programs of social uplift is approaching spiritual doom. > > Martin Luther King, Jr. > > >=20 >=20 > -- > A nation that continues year after year to spend more money on military d= efense > than on programs of social uplift is approaching spiritual doom. > Martin Luther King, Jr. >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your ver= y > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Gmailagent-devel mailing list > Gma...@li... > https://lists.sourceforge.net/lists/listinfo/gmailagent-devel > |
|
From: Stas Z <sta...@gm...> - 2005-09-18 15:06:26
|
Yet another update :-) I'm halfway refactoring libgmail. The reason why I don't commit it to CVS is that I'm not convinced that the end result would be good enough to replace the parsing as we have it now in libgmail. I making progress, slow but steady :-) I hope the end result would be a cleaner and saver libgmail. Stas On 9/18/05, Stas Z <sta...@gm...> wrote: > On 9/18/05, Stas Z <sta...@gm...> wrote: > > Just a quick update. > > > > I'm currently replacing the libgmail page parser for the parser from An= drew. > > This will resolve two issues. > Bummer, contacts work perfectly with the new parser, but it fails to pars= e other > pages. (inbox, sent etc) >=20 > I'm off for a few hours, but return in 4 hours from now. > If anyone wants to get a shot at this, please contact me to avoid doing t= he same > thing twice. >=20 > Stas >=20 > -- > A nation that continues year after year to spend more money on military d= efense > than on programs of social uplift is approaching spiritual doom. > Martin Luther King, Jr. >=20 --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-18 10:35:44
|
On 9/18/05, Stas Z <sta...@gm...> wrote: > Just a quick update. >=20 > I'm currently replacing the libgmail page parser for the parser from Andr= ew. > This will resolve two issues. Bummer, contacts work perfectly with the new parser, but it fails to parse = other pages. (inbox, sent etc) I'm off for a few hours, but return in 4 hours from now. If anyone wants to get a shot at this, please contact me to avoid doing the= same thing twice. Stas --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-18 09:58:08
|
Just a quick update. I'm currently replacing the libgmail page parser for the parser from Andrew= . This will resolve two issues. 1. The security bug Andrew reported. 2. The broken contacts support. I hope to finish it in a few hours from now. Cheers, Stas --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-18 07:13:50
|
As of this moment the contacts support seems broken due to a change in Gmai= l. I suspect they have a cron job for changing the pages at random just for fu= n :-/ On 9/18/05, Andrew Lin <one...@gm...> wrote: > Hi Stas et al., >=20 > I've subscribed myself to gmailagent-devel, so you won't need to cc me an= ymore. >=20 > 1. A good point. The reason I wanted this functionality is that gmail > is my primary email system (in fact, the only other one I use is > Outlook/Exchange, against my will...) and as such I wanted to keep my > primary address book in the same place. I don't know how many other > people are in that boat. Ok, so there's a need for extended contacts. =20 > 2. An optimization you could look at is not reading a contact in full > (i.e., in your case calling _getSpecInfo()) if you can tell that the > notes field is empty. I guess there may be corner cases (what happens > if the first line of notes is blank?) to investigate; I'm sure that > that won't happen in my personal address book, so I didn't bother > checking before putting this in my module. I think we could use the 'old' notes retrieval and use the full notes as a option with a time delay. > 3. I actually believe my code is safer. I tried for some time to > break out of the restricted evaluation mode you get by setting > __builtins__ to None, to no avail. Furthermore, I'm fairly sure that > even if you could get out of that with carefully constructed code, it > would require Google programmers to deliberately inject that code into > their returned Javascript to exploit it. Your probably right, I must confess I forgot that our parser uses unsave stuff :-( > On the other hand, since you got me to thinking about it, I think I > can show how libgmail's parser is currently unsafe. Because I'm not > sure how serious a security hole this is, I'll send details to Stas > and await his approval to mail the list. Thanks, I will forward it to Waseem too. @Waseem, it's a security risk indeed :-( Stas --=20 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. |
|
From: Andrew L. <one...@gm...> - 2005-09-17 22:04:17
|
Hi Stas et al., I've subscribed myself to gmailagent-devel, so you won't need to cc me anym= ore. 1. A good point. The reason I wanted this functionality is that gmail is my primary email system (in fact, the only other one I use is Outlook/Exchange, against my will...) and as such I wanted to keep my primary address book in the same place. I don't know how many other people are in that boat. 2. An optimization you could look at is not reading a contact in full (i.e., in your case calling _getSpecInfo()) if you can tell that the notes field is empty. I guess there may be corner cases (what happens if the first line of notes is blank?) to investigate; I'm sure that that won't happen in my personal address book, so I didn't bother checking before putting this in my module. 3. I actually believe my code is safer. I tried for some time to break out of the restricted evaluation mode you get by setting __builtins__ to None, to no avail. Furthermore, I'm fairly sure that even if you could get out of that with carefully constructed code, it would require Google programmers to deliberately inject that code into their returned Javascript to exploit it. On the other hand, since you got me to thinking about it, I think I can show how libgmail's parser is currently unsafe. Because I'm not sure how serious a security hole this is, I'll send details to Stas and await his approval to mail the list. Andrew On 9/17/05, Stas Z <sta...@gm...> wrote: > Hello >=20 > Just some random thoughts about the contacts support in libgmail > including the extended notes stuff andrew cooked up. >=20 > 1. Do we really need the extended data from the contacts? > I think that a person that really wants to keep all kinds of > data about their contacts will use evolution of some other app > but probably doesn't use Gmail contacts. >=20 > 2. We *must* consider adding some sort of delay between page > requests to Gmail. We are risking "Lockdown error in sector 4" > situations when users have a lot of contacts. > "Lockdown...." is when Gmail disables the account for a period of > time due to usual Gmail usage. > User 'posey_p' has reported this: > """ > I am calling getSpecInfo() for each entry to get their notes fields for= each > gmail contact. After a certain number of requests, Gmail sends me an "Unu= sual > usage error" and disables my account! > """ >=20 > 3. Should we use Andrews approach of 'parsing' javascript by using Python= 's > exec statement or use libgmail's text processing? > The exec approach seems to be better when it comes to unusual characters > inside the page but I feel that the libgmail way is much more secure. >=20 > Cheers, > Stas >=20 > -- > A nation that continues year after year to spend more money on military d= efense > than on programs of social uplift is approaching spiritual doom. > Martin Luther King, Jr. > |
|
From: Stas Z <sta...@gm...> - 2005-09-17 18:49:57
|
Hello Just some random thoughts about the contacts support in libgmail including the extended notes stuff andrew cooked up. 1. Do we really need the extended data from the contacts? I think that a person that really wants to keep all kinds of data about their contacts will use evolution of some other app but probably doesn't use Gmail contacts. 2. We *must* consider adding some sort of delay between page requests to Gmail. We are risking "Lockdown error in sector 4" situations when users have a lot of contacts. "Lockdown...." is when Gmail disables the account for a period of time due to usual Gmail usage. User 'posey_p' has reported this: """=20 I am calling getSpecInfo() for each entry to get their notes fields for e= ach gmail contact. After a certain number of requests, Gmail sends me an "Unusu= al usage error" and disables my account! """ 3. Should we use Andrews approach of 'parsing' javascript by using Python's exec statement or use libgmail's text processing? The exec approach seems to be better when it comes to unusual characters inside the page but I feel that the libgmail way is much more secure. Cheers, Stas --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-17 05:52:17
|
On 9/17/05, Andrew Lin <one...@gm...> wrote: > Hi, >=20 > Two weeks ago I sent the following email to fol...@my..., > but looking at the latest credits in libgmail.py I realize that I may > have done better to send it to you: Normally he forwards them to us, but I fear he's forgot this one :-( =20 > "Apologies if you would rather I post this to a bug report or mailing > list; just let me know. We also use the mailinglist gmail-devel,=20 http://lists.sourceforge.net/lists/listinfo/gmailagent-devel [...]=20 > Lacking a reply I decided to write something simple for myself. > Nonetheless, I'm still curious to know if you would be interested in > adding such functionality to libgmail. FYI, my module can be found at > http://mattpanaro.us/~andrew/gmail.py ; it is of course pre-pre-alpha, > use only on a test account, etc. Please feel free to use whatever > code or ideas from it you want. Great, thanks. We certainly want to add such extended support to libgmail. From a quick look at your module I saw that you put in a little pause betwe= en calls, just the thing i want to add to libgmail this morning. Saves me some= work this mail from you :-) > Also, in the course of this project, I discovered a bug in libgmail: > put ");" in the notes field of a contact, and attempt to download > contacts, and the parser will incorrectly interpret that as the end of > the D(); call, and fail. I get around this by defining D(); as a > Python function and using exec. Thanks again. I will look at you module and contact you about my findings. =20 Regards, Stas Zytkiewicz --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-16 14:03:35
|
On 9/16/05, Stas Z <sta...@gm...> wrote: > ---------- Forwarded message ---------- > From: SourceForge.net <no...@so...> > Date: Sep 16, 2005 2:51 AM > Subject: [libgmail - Open Discussion] RE: Unusual Usage error > To: no...@so... >=20 >=20 >=20 > Read and respond to this message at: > https://sourceforge.net/forum/message.php?msg_id=3D3341157 > By: posey_p >=20 > Turns out many people have reported a "Lockdown error in sector 4" by gma= il. > I'm getting this error after I send multiple requests to gmail for user n= otes. >=20 > How can I read all the notes at once? Or at least prevent this ridiculous= error? The problem is that with the normal libgmail way of fetching notes you requ= est a page from Gmail with all the contacts containing the name, email, and one line of the notes. That's one page with all the notes. With your code there's a request for every note. You can imagine that when you have a lot of contacts it might look like a D= OS attack :-) However, I feel we should use your code as it's retrieving all of the notes instead of only the first line. I'm not sure how we could refactor your code so that it complies with Gmail terms of service. Stas --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-16 12:31:53
|
---------- Forwarded message ---------- From: SourceForge.net <no...@so...> Date: Sep 16, 2005 2:51 AM Subject: [libgmail - Open Discussion] RE: Unusual Usage error To: no...@so... Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3D3341157 By: posey_p Turns out many people have reported a "Lockdown error in sector 4" by gmail= . I'm getting this error after I send multiple requests to gmail for user not= es. How can I read all the notes at once? Or at least prevent this ridiculous e= rror? ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=3D388073 --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-16 12:31:39
|
Waseem, it looks that we should look into this notes issue before releasing :-( ---------- Forwarded message ---------- From: SourceForge.net <no...@so...> Date: Sep 15, 2005 10:58 PM Subject: [libgmail - Open Discussion] Unusual Usage error To: no...@so... Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3D3340937 By: posey_p I am calling getSpecInfo() for each entry to get their notes fields for ea= ch gmail contact. After a certain number of requests, Gmail sends me an "Unusu= al usage error" and disables my account! Is there a way I can read all the Notes fields at once? Or is there at leas= t a way I can avoid having my account disabled by gmail? Thanks. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=3D388073 --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-13 14:56:02
|
On 9/13/05, Stas Z <sta...@gm...> wrote: > On 9/13/05, Richard Jones <jo...@gm...> wrote: >=20 > > > > Whilst I'm writing to you I have a feature request, it seems the on= ly > > > > way of getting the message body for a message in a thread is to do = the > > > > equivalent of "show original", > [...] > > > > This would lead to a dramatic speed improvement for me. > > > How would that lead to a speed improvement ? > > > Gmail itself doesn't support "body only view". [...] > Hmmm, it seems we can only retrieve the "original page". > We will look into this. [....] > I think we try to get other views too. After I did some checking it seems that it doesn't make any difference in s= peed what kind of view you choose. Every message must be fetch from Gmail when it's needed. I mean that it doe= sn't matter that we show the original, if speed is concerned. However I'm not sure that my reasoning is sound, so Waseem if you have a few minutes I would like to get your ideas about this. Stas --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-13 11:51:20
|
On 9/13/05, Richard Jones <jo...@gm...> wrote:
> > > Whilst I'm writing to you I have a feature request, it seems the only
> > > way of getting the message body for a message in a thread is to do th=
e
> > > equivalent of "show original",
[...]
> > > This would lead to a dramatic speed improvement for me.
> > How would that lead to a speed improvement ?
> > Gmail itself doesn't support "body only view".
> >
>=20
> def _getSource(self):
> """
> """
> if not self._source:
> # TODO: Do this more nicely...?
> # TODO: Strip initial white space & fix up last line ending
> # to make it legal as per RFC?
> self._source =3D self._account.getRawMessage(self.id)
>=20
> return self._source
>=20
> source =3D property(_getSource, doc =3D "")
>=20
> I may be wrong but last time I checked I thought
> getRawMessage(self.id) did an equivalent to the
> "show original" button available under more options, rather than what
> is shown in the message view window. Retrieving this seems to be a
> very slow operation. Perhaps I've made a mistake and getRawMessage()
> behaves differently than I expected.
Hmmm, it seems we can only retrieve the "original page".
We will look into this.
@Waseem it seems that the only constant that results in a page is
U_ORIGINAL_MESSAGE_VIEW
I've changed this in libgmail (CVS):
def getRawMessage(self, msgId):
"""
"""
# U_ORIGINAL_MESSAGE_VIEW seems the only one that returns a page.
# All the other U_* results in a 404 exception
PageView =3D U_ORIGINAL_MESSAGE_VIEW =20
return self._retrievePage(
_buildURL(view=3DPageView, th=3DmsgId))
I think we try to get other views too.
Stas
--=20
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.
|
|
From: Stas Z <sta...@gm...> - 2005-09-13 11:22:20
|
Waseem,
First things first:
We don't have support for multiple lines in the contacts notes because
the part of
the page we parse only gets the first partial line from the original
contacts notes.
A solution comes from the SF user "posey_p"
(Taken from the forum)
By: Posey - posey_p
Contacts Notes =20
2005-09-13 01:38
Hi. Is there a way to read all of the "Notes" information under a Contact?=
=20
=20
When my contacts have a long Notes field, it reads part of the field,
and the trailing ellipses (...), rather than reading the whole field.
By: Posey - posey_p
RE: Contacts Notes =20
2005-09-13 02:17
Sort of figured it out ...=20
add this to class GmailAccount:=20
=20
def getSpecInfo(self,id):=20
"""=20
Return some cool notes data.=20
"""=20
myURL =3D _buildURL(search=3D'contacts',ct_id=3Did,c=3Did,at=3Dself._=
cookieJar._cookies['GMAIL_AT'],view=3D'ct')
pageData =3D self._retrievePage(myURL)=20
myData =3D self._parsePage(myURL)=20
for x in myData['cov']:=20
print x=20
print=20
=20
# myData contains values other than 'cov'=20
I have implemented this into libgmail to provide multiline support.
I paste the relevant pieces from the CVS diff.
@@ -731,7 +733,10 @@ class GmailAccount:
# if they change, chances are that something *bigger* in
gmail changed
# that we're not ready to deal with
if len(entry) >=3D 6:
- newGmailContact =3D GmailContact(entry[1], entry[2],
entry[4], entry[5])
+ ##newGmailContact =3D GmailContact(entry[1], entry[2],
entry[4], entry[5])
+ rawnotes =3D self._getSpecInfo(entry[1])
+ #print rawnotes
+ newGmailContact =3D GmailContact(entry[1], entry[2],
entry[4],rawnotes)
contactList.append(newGmailContact)
.......
.......
+ def _getSpecInfo(self,id):
+ """
+ Return some cool notes data.
+ """
+ myURL =3D_buildURL(search=3D'contacts',ct_id=3Did,c=3Did,\
+ at=3Dself._cookieJar._cookies['GMAIL_AT'],view=3D'=
ct')
+ pageData =3D self._retrievePage(myURL)
+ myData =3D self._parsePage(myURL)
+ #print "myData",myData
+ rawnotes =3D myData['cov'][7]
+ return rawnotes[1]
Stas
--=20
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.
|
|
From: Stas Z <sta...@gm...> - 2005-09-13 07:33:13
|
On 9/13/05, Richard Jones <jo...@gm...> wrote:
> Thanks Stas,
>=20
> I really appreciate the rapid releases you guys are doing at the
> moment, it makes my life as gmailfs developer much less painful.
Thanks, but it was Waseem who actually fixed it :-)
=20
> Whilst I'm writing to you I have a feature request, it seems the only
> way of getting the message body for a message in a thread is to do the
> equivalent of "show original",=20
To be clear, now you do something like?
>>> ga =3D libgmail.GmailAccount("account","passwrd")
>>> ga.login()
>>> thread =3D ga.getMessagesByFolder('inbox')
>>> for obj in thread:
... for mesg in obj:
... print mesg.source
...=20
Perhaps I'm going to ask the obvious questions, but I never used gmailfs :-=
)
>I might be missing something but I
> thought it should be possible to get the same text that is shown in
> the display.
You mean the text seen when you use a browser?
> This would lead to a dramatic speed improvement for me.
How would that lead to a speed improvement ?
Gmail itself doesn't support "body only view".
Stas
--=20
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.
|
|
From: Stas Z <sta...@gm...> - 2005-09-13 07:01:58
|
I was wondering about this piece of toplevel code present in all libgmial
modules.
See my added comments.
# Allow us to run using installed `libgmail` or the one in parent directory=
.
try:
import libgmail
## Wouldn't this the preffered way?
## We shouldn't raise a warning about a normal import
##logging.warn("Note: Using currently installed `libgmail` version.")
except ImportError:
# Urghhh...
sys.path.insert(1,
os.path.realpath(os.path.join(os.path.dirname(__file__)=
,
os.path.pardir)))
import libgmail
I don't think we should raise a warning message about something I
consider normal
import behaviour.
When I import something in Python I *expect* that it would import the
currently installed
version :-)
I would expect a warning telling me it uses a local version as using a
local version seems
like a securety issue to me.
It's the same as adding ".' to your Bash path.
Stas
--=20
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.
|
|
From: Stas Z <sta...@gm...> - 2005-09-12 18:17:52
|
Hello, As you probably know, Gmail changed their login page and thus broke libgmail. Waseem Daher, with some help from two 'powerusers', fixed the problem and released a new version of libgmail just a few minutes ago. It's available at the usual place: http://sourceforge.net/project/showfiles.php?group_id=3D113492&package_id= =3D122807 Cheers, Stas Zytkiewicz --=20 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. |
|
From: Stas Z <sta...@gm...> - 2005-09-12 17:43:04
|
On 9/12/05, Waseem S. Daher <wd...@mi...> wrote: > I've fixed the latest libgmail bug, with the help of a bug report by SF > user "ibbumpin". Your the man Waseem :-) And the other helpful users of course. This is a fine example how well FOSS works. =20 > The latest version is checked into CVS and is functional as far as I can > tell (that is to say, the contacts test suite passes, and so does > running libgmail on its own). I think it might be instructive to have a > test suite that exercises more of libgmail's functionality, though. I also tested it and everything works. > Anyway, just FYI. >=20 > We should probably repackage this ASAP, huh. If you put it on SF, I suggest version 0.1.1, then I will announce it of freshmeat and I'll also contact the gmailfs author. Stas=20 --=20 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. |
|
From: Waseem S. D. <wd...@MI...> - 2005-09-12 17:28:13
|
I've fixed the latest libgmail bug, with the help of a bug report by SF user "ibbumpin". The latest version is checked into CVS and is functional as far as I can tell (that is to say, the contacts test suite passes, and so does running libgmail on its own). I think it might be instructive to have a test suite that exercises more of libgmail's functionality, though. Anyway, just FYI. We should probably repackage this ASAP, huh. - W |
|
From: Stas Z <sta...@gm...> - 2005-09-12 13:23:16
|
On 9/12/05, Waseem S. Daher <wd...@mi...> wrote: > On Mon, 2005-09-12 at 14:40 +0200, Stas Z wrote: > > > > We need javascript Python bindings :-) > I was more being facetious than anything else -- I'm not totally > convinced there's an easy way to handle these gmail changes totally > agnostically. I mean, I guess gmail tells us what 'objects' correspond > to what variable names, in javascript, but there's nothing really to say > that those variable names won't change (and if they do, we need to > rewrite some code), right? You right, I'm wrong. I've warned you about my knowledge of javascript :-) =20 > I guess we could try to parse some javascript in the Python, but I guess > I don't see what's to be gained from doing it. (Though it's probably > that I just don't understand what's going on with what you're proposing) My line of thinking was something like this: - Gmail changes it's pages. - libgmail is broken. - Firefox, or any other browser, is not broken. - Why? - Because firefox parses the webpages while libgmail hacks into them with regexp etc. So I was thinking about some way to "run" the javascript rather then trying= to get the information out of it. Yeah, I realize that running javascript is something only done by lunatics, it's just a thought :-) After googling for "Python parsing javascript" I think I will forget my parsing ideas. Stas =20 --=20 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. |