Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Python (http://www.programmingforums.org/forum43.html)
-   -   Fixing libgmail pipe-menu for Openbox window-manager (http://www.programmingforums.org/showthread.php?t=14667)

dezza Dec 3rd, 2007 8:39 AM

Fixing libgmail pipe-menu for Openbox window-manager
 
Hey guys. I though I was clever, and took my basic Python skills, that I got for one year ago, reading trough some tutorials and stuff.. I digged into this simple pipe-menu for the window-manager Openbox, that shows if you have new messages in GMail in the right-click Openbox menu.

I quickly found out, that the newest version wouldn't work, the only one that worked, was the slow 0.1 proof-of-concept code.

Old code (works): http://gamma.pnosker.com/files/gmail-openbox-0.0.1.py

New code (crashes): http://gamma.pnosker.com/files/gmail-openbox-0.0.3.1.py

I tried running both in Python instead of trough Openbox, and the latest code (0.0.3.1) gives me this: http://pastebin.com/m71cec523
I was wondering what in the new code makes it behave like this? I think that it looks like using the same functions with same parameters, but I couldn't find a trace of those errors.

If I try to run it as the pipe-menu (which of course doesn't work neither) Openbox says this: http://pastebin.com/m339e39d2
Hehe, Openbox' error message is quite weird, cause of course the file exists, I replaced it myself, it just won't work, but claiming it doesn't exist is a lie, and maybe a coding issue of Openbox itself.

I would really appreciate this, not only because of helping me, but also to help me understand this code and why it errors.

Sane Dec 3rd, 2007 12:49 PM

Re: Fixing libgmail pipe-menu for Openbox window-manager
 
If self.opener for the GmailAccount class is None, that means it hasn't yet been defined ater it was initiated to None in the __init__ method. It will most oftenly be redefined in one of the first methods called, such as ga.login(). So make sure that is being called successfully. You can also tear apart the libgmail code to see when exactly self.opener is assigned None, and when it is assigned a urllib2() instance.

Also, are you aware that gmail recently changed its UI? I actually submitted a bug change to fix this problem for this very same module (libgmail), but I'm not sure if the developers appended my revision yet. If libgmail works in your old code, make sure you are including the same libgmail in both your old and new code. You may be experiencing problems related to this change.

dezza Dec 3rd, 2007 5:10 PM

Re: Fixing libgmail pipe-menu for Openbox window-manager
 
Yes but I did use the newest libgmail. The latest version of that menu is from 2005 as what I've seen one place.

Sane Dec 3rd, 2007 5:12 PM

Re: Fixing libgmail pipe-menu for Openbox window-manager
 
When I said recently, I meant very recently. About 2 weeks ago I think.

If they are both identical libgmails you're importing, let me know and I'll look more closely when I have time.


All times are GMT -5. The time now is 4:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC