Code-style fixes

This commit is contained in:
Mark Haines 2015-02-10 16:30:48 +00:00
parent 697ab75a34
commit b085fac735
11 changed files with 57 additions and 36 deletions

View file

@ -140,7 +140,7 @@ class Pusher(object):
lambda x: ('[%s%s]' % (x.group(1) and '^' or '',
re.sub(r'\\\-', '-', x.group(2)))), r)
return r
def _event_fulfills_condition(self, ev, condition, display_name, room_member_count):
if condition['kind'] == 'event_match':
if 'pattern' not in condition:
@ -170,8 +170,10 @@ class Pusher(object):
return False
if not display_name:
return False
return re.search("\b%s\b" % re.escape(display_name),
ev['content']['body'], flags=re.IGNORECASE) is not None
return re.search(
"\b%s\b" % re.escape(display_name), ev['content']['body'],
flags=re.IGNORECASE
) is not None
elif condition['kind'] == 'room_member_count':
if 'is' not in condition: