rcarmo/rss2imap

Missing config.py causes exceptions.

Closed this issue · 4 comments

dme commented

If no config.py can be found, rss2email.py will raise an exception (missing UNICODE_SNOB).

Two alternative solutions strike me:

  • require a config.py (i.e. fail if it cannot be loaded),
  • add defaults for all of the config.py settings to rss2email.py before importing the config.

Actually, I was going for the first. I removed all the options from rss2email.py because they were simply cluttering up the source -- and I intend to break up rss2email.py into modules for easier maintenance (having it all in one file crammed with huge functions and if clauses gives me the shivers...)

dme commented

In that case, I'll shelve the changes to fix the default email and add a default folder - they can be specified in the config.py file and we can get rid of the code that stores a default email at the head of the feed list. Seem reasonable?

The changes I have (and will abandon) are:
dme/rss2email@98e152e
dme/rss2email@064daa9

Yeah, seems reasonable. Feel free to strip out stuff and build modules.

I had in mind five modules (besides main):

  • collection (a thin abstraction over feedparser that built the URL openers, set up defaults, etc., so that we can plug in multiprocessing/threading later)
  • storage (so that we can plug in SQLite later)
  • parsing (for HTML cleanup, grabbing links, etc.)
  • delivery (split into smtp and imap)
  • cli

Also, add yourself to the contributors list :)