diff options
| author | Barry Warsaw | 2007-08-05 07:30:30 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-08-05 07:30:30 -0400 |
| commit | 2999c404a486cb0c7bd76407501e0a6b775c148a (patch) | |
| tree | 83645fed9d0e69654d5852067ec6ee02ab80fe31 /Mailman/app/styles.py | |
| parent | 959f34a62e0ec3cbe73da3d43640ccb6791cf3a0 (diff) | |
| download | mailman-2999c404a486cb0c7bd76407501e0a6b775c148a.tar.gz mailman-2999c404a486cb0c7bd76407501e0a6b775c148a.tar.zst mailman-2999c404a486cb0c7bd76407501e0a6b775c148a.zip | |
Added a doctest for styles.
Diffstat (limited to 'Mailman/app/styles.py')
| -rw-r--r-- | Mailman/app/styles.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/app/styles.py b/Mailman/app/styles.py index 55d8aa690..e0bf58cde 100644 --- a/Mailman/app/styles.py +++ b/Mailman/app/styles.py @@ -45,6 +45,8 @@ class DefaultStyle: priority = 0 # the lowest priority style def apply(self, mailing_list): + # For cut-n-paste convenience. + mlist = mailing_list # Most of these were ripped from the old MailList.InitVars() method. mlist.volume = 1 mlist.post_id = 1 @@ -248,12 +250,14 @@ class StyleManager: matched_styles = [] for style in self.styles: style.match(mailing_list, matched_styles) - for style in sorted(matched_styles, key=attrgetter('priority')): + for style in matched_styles: yield style @property def styles(self): - for style in sorted(self._styles.values(), key=attrgetter('priority')): + for style in sorted(self._styles.values(), + key=attrgetter('priority'), + reverse=True): yield style def register(self, style): |
