Ticket #62 (closed task: fixed)

Opened 5 years ago

Last modified 5 years ago

clean up email changesource parsers

Reported by: warner Owned by: warner
Priority: major Milestone: 0.7.6
Version: 0.7.5 Keywords:
Cc:

Description

things to do:

  • fix the getattr-on-self-makes-bound-method python surprise that requires the mail parser functions to take 'self' as a first argument
  • put all the email parser functions in a single file
  • refactor the parser functions as much as is reasonable
  • use exactly one mail-based ChangeSource class, which accepts an argument that specifies the parsing function to use
  • create a directory structure in the unit test dir to hold the parser test cases
  • create new tickets to solicit parser test cases, one per parser

Change History

comment:1 Changed 5 years ago by warner

  • Status changed from new to assigned

I changed my mind, I think it's easier to configure the buildmaster when each parser has a separate class. So the user will do c['sources'] = SyncmailMaildirSource(basedir).

(also note that c['sources'] will accept a single instance or a list. Maybe we should rename this to c['source'] or c['changesource'] )

Doing it as a class also means we can refactor the parsers. In particular the email.Message creation should be common for all of the parsers.

comment:2 Changed 5 years ago by warner

I'm going to go ahead and change the config key to cchangesource?. It takes a single ChangeSource instance. But, if you give it a list, it will accept that too.

csources? is deprecated but still usable for at least this release. I'll schedule it for removal in some future release.

comment:3 Changed 5 years ago by warner

  • Status changed from assigned to closed
  • Resolution set to fixed

done. I think we still need a test for the bonsai mail parser. I've added ticket #66 for this.

Note: See TracTickets for help on using tickets.