# HG changeset patch # User Paul Boddie # Date 1298235923 -3600 # Node ID a2f1f25d42711014464bc1fd34e353ab2111a085 # Parent 36be1eee1157fef0cf6f9aa107d4572b08dc4f2a Fixed category membership discovery. (Imported from revision 158.) diff -r 36be1eee1157 -r a2f1f25d4271 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Sat Feb 19 17:08:30 2011 +0100 +++ b/EventAggregatorSupport.py Sun Feb 20 22:05:23 2011 +0100 @@ -46,7 +46,7 @@ # Page parsing. definition_list_regexp = re.compile(ur'(?P^(?P#*)\s+(?P.*?):: )(?P.*?)$', re.UNICODE | re.MULTILINE) -category_membership_regexp = re.compile(ur"^\s*((Category\S+)(\s+Category\S+)*)\s*$", re.MULTILINE | re.UNICODE) +category_membership_regexp = re.compile(ur"^\s*(?:(Category\S+)(?:\s+(Category\S+))*)\s*$", re.MULTILINE | re.UNICODE) # Value parsing. @@ -490,7 +490,7 @@ if self.categories is None: body = self.getBody() match = category_membership_regexp.search(body) - self.categories = match.findall().split() + self.categories = match and [x for x in match.groups() if x] or [] return self.categories @@ -891,6 +891,8 @@ full_coverage.update(event_coverage) # Add a new events list for a new location. + # NOTE: Consider not doing this for month views, since it can lead + # NOTE: to poor usage of space. # Locations can be unspecified, thus None refers to all unlocalised # events.