Tim Riley wrote:
> I am trying to access my gmail account using the latest IronPython
> Community Edition (IPY, not IPY2) and the python feedparser library.
> When I run the following script through python 2.5 everything works
> great, however when I run it through ipy.exe I get an error. I was
> wondering if anyone has any experience using feedparser with ipy and
> if so if they could give me a pointer on how to get this working.
>
>
>
What happens if you replace the line:
print usermail.feed.title
With
print dir(usermail.feed)
?
The feedparser code isn't failing, but it looks like you aren't getting back
what you expect...
Michael
http://www.manning.com/foord
> Here is the code:
>
> #################code#####################
> #Note: Build with IronPython Community Edition, Not Standard IronPython
>
> #import statements
> import ConfigParser
> import feedparser
>
>
> def generateURL():
> """
> Generates a the url for the ATOM feed by reading the username and
> password from the config file.
> """
> config = ConfigParser.ConfigParser()
> config.read("config.ini")
> return "https://%s:[EMAIL PROTECTED]/gmail/feed/atom" %
> (config.get("app:main", "username"), config.get("app:main",
> "password"))
>
>
> def checkmail():
> usermail = feedparser.parse(generateURL())
> #for testing only
> print usermail.feed.title
> print len(usermail['entries'])
>
> if __name__ == "__main__":
> checkmail()
> #################code#####################
>
>
> and here is the output:
>
> ################output####################
>
>
>
> C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>python ipygmail.py
> Gmail - Inbox for [EMAIL PROTECTED]
> 9
>
> C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>ipy ipygmail.py
> Traceback (most recent call last):
> File C:\Documents and
> Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l
> ine 25, in Initialize
> File C:\Documents and
> Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l
> ine 20, in checkmail
> AttributeError: title
>
> ################output####################
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com