annotate ImapFeed.py @ 8:4d61c56473c2 default tip

Fixed a problem where some feeds would have unpickleable expatreaders.
author Atul Varma <varmaa@toolness.com>
date Fri, 18 Apr 2008 17:13:02 -0700
parents c461e818f4ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
1 import imaplib
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
2 import time
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
3 from email.feedparser import FeedParser
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
4 from email.utils import parsedate
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
5 import elementtree.ElementTree as ET
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
6
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
7 from LocalAuth import IMAP_AUTH
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
8 from Config import IMAP_FEEDS
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
9
4
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
10 def getFeedInfo():
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
11 for feed in IMAP_FEEDS:
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
12 info = dict( importance = 1 )
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
13 info.update( feed )
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
14 yield info
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
15
0
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
16 def getImapUnreadMailInfo( server, port, username, password,
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
17 mailbox = "INBOX", isSsl = True ):
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
18 if isSsl:
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
19 imap = imaplib.IMAP4_SSL( server, port )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
20 else:
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
21 imap = imaplib.IMAP4( server, port )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
22
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
23 imap.login( username, password )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
24 imap.select( mailbox )
7
c461e818f4ca Changed ImapFeed.py so that it now looks for unread and flagged (starred in gmail) messages. This also looks like it will solve the problem w/ marking an entire conversation as unread in gmail, since starring a conversation doesn't make every single msg in the conversation flagged, it only flags the latest message.
Atul Varma <varmaa@toolness.com>
parents: 4
diff changeset
25
c461e818f4ca Changed ImapFeed.py so that it now looks for unread and flagged (starred in gmail) messages. This also looks like it will solve the problem w/ marking an entire conversation as unread in gmail, since starring a conversation doesn't make every single msg in the conversation flagged, it only flags the latest message.
Atul Varma <varmaa@toolness.com>
parents: 4
diff changeset
26 # For more information on searching IMAP, see:
c461e818f4ca Changed ImapFeed.py so that it now looks for unread and flagged (starred in gmail) messages. This also looks like it will solve the problem w/ marking an entire conversation as unread in gmail, since starring a conversation doesn't make every single msg in the conversation flagged, it only flags the latest message.
Atul Varma <varmaa@toolness.com>
parents: 4
diff changeset
27 # http://tools.ietf.org/html/rfc3501#section-6.4.4
c461e818f4ca Changed ImapFeed.py so that it now looks for unread and flagged (starred in gmail) messages. This also looks like it will solve the problem w/ marking an entire conversation as unread in gmail, since starring a conversation doesn't make every single msg in the conversation flagged, it only flags the latest message.
Atul Varma <varmaa@toolness.com>
parents: 4
diff changeset
28 typ, msgnums = imap.search( None, "(OR (FLAGGED) (UNSEEN))" )
c461e818f4ca Changed ImapFeed.py so that it now looks for unread and flagged (starred in gmail) messages. This also looks like it will solve the problem w/ marking an entire conversation as unread in gmail, since starring a conversation doesn't make every single msg in the conversation flagged, it only flags the latest message.
Atul Varma <varmaa@toolness.com>
parents: 4
diff changeset
29
0
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
30 if typ != "OK":
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
31 raise IOError( "Error searching IMAP folder" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
32 msgnums = [ int( num ) for num in msgnums[0].split() ]
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
33 for num in msgnums:
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
34 typ, result = imap.fetch( str(num), "(BODY.PEEK[HEADER])" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
35 if typ != "OK":
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
36 raise IOError( "Error fetching IMAP messages" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
37 headers = result[0][1]
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
38 parser = FeedParser()
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
39 parser.feed( headers )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
40 message = parser.close()
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
41 # TODO: Make sure that the timezone info is converted properly.
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
42 timestamp = time.mktime( parsedate(message["Date"]) )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
43 yield dict( timestamp = timestamp,
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
44 sender = message["From"],
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
45 subject = message["Subject"] )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
46 imap.close()
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
47 imap.logout()
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
48
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
49 def _addTextNode( element, name, text ):
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
50 subElement = ET.SubElement( element, name )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
51 subElement.text = text
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
52
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
53 def makeFeedFromMailInfo( infoIterator, url ):
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
54 root = ET.Element( "rss" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
55 root.set( "version", "2.0" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
56 channel = ET.SubElement( root, "channel" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
57 for info in infoIterator:
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
58 item = ET.SubElement( channel, "item" )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
59 _addTextNode( item, "title", info["subject"] )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
60 _addTextNode( item, "pubDate",
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
61 time.ctime( info["timestamp"] ) )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
62 _addTextNode( item, "link", url )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
63 _addTextNode( item, "description",
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
64 "From %s" % info["sender"] )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
65 tree = ET.ElementTree( root )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
66
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
67 import StringIO
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
68 strFile = StringIO.StringIO()
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
69 tree.write( strFile )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
70 return strFile.getvalue()
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
71
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
72 def generateFeed( feed, auth ):
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
73 imapParams = dict( server = feed["server"],
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
74 port = feed["port"],
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
75 mailbox = feed["mailbox"],
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
76 isSsl = feed["isSsl"] )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
77 imapParams.update( auth[imapParams["server"]] )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
78 open( feed["filename"], "w" ).write(
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
79 makeFeedFromMailInfo( getImapUnreadMailInfo(**imapParams),
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
80 feed["url"] )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
81 )
2110430f4d7f Origination. Two critical files for any of this to work, Config.py and LocalAuth.py, aren't included here because they contain sensitive information, so this is effectively broken at the moment. I'll have to do a bit of refactoring and make a second commit.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
82
4
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
83 def update( feed ):
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
84 print "Generating feed for %s" % feed["name"]
df9d4e704257 Made the architecture a little cleaner, but it's still pretty messy; I really need to turn some OO-like-hacks into actual OO constructions. At least the Config.py structure is simpler.
Atul Varma <varmaa@toolness.com>
parents: 0
diff changeset
85 generateFeed( feed, IMAP_AUTH)