This will serve as a basis for reading and applying watch lists.
Created attachment 108716 [details]
Comment on attachment 108716 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=108716&action=review
> +class WatchList:
new-style classes (python 2.5 and above?) always subclass from (object)
> + # Parse the top level sections in the watch list.
> + for section in watch_list:
> + parser = watch_list_parsers.get(section)
> + if not parse_method:
> + raise Exception('Unknown section in watch list: %s' % section)
> + parser(watch_list[section])
I would think you'd want a separate WatchListParser class or Factory class which could produce these, leaving WatchList to just be the model.
> + def _verifyException(self, regex_message, callable, *args):
> + try:
Sad. Python 2.7 has something like this in unittest, but pre-2.7 doesn't.
Created attachment 108720 [details]
Comment on attachment 108720 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=108720&action=review
> +def parse_watch_list(watch_list_contents):
Normally we'd name the package with a noun, so watchlistparser.py
Committed as http://trac.webkit.org/changeset/95995