hgpoll.py

changeset 76
a2fe9ba3041a
parent 73
d67cc4fbc3f1
child 85
302e2bec51d8
equal deleted inserted replaced
75:1818d56c8ff5 76:a2fe9ba3041a
101 line = line.replace ('[color=#5F7][/color]', '').replace ('[color=#F53][/color]', '') 101 line = line.replace ('[color=#5F7][/color]', '').replace ('[color=#F53][/color]', '')
102 102
103 result += line 103 result += line
104 104
105 return result 105 return result
106
107 def find_developer_by_email (commit_email):
108 for developer, emails in Config.get_value ('developer_emails', default={}).iteritems():
109 if commit_email in emails:
110 return developer
111
112 return ''
113 106
114 def poll(): 107 def poll():
115 global repocheck_timeout 108 global repocheck_timeout
116 if time.time() < repocheck_timeout: 109 if time.time() < repocheck_timeout:
117 return 110 return
220 match = rex.match (commit_author) 213 match = rex.match (commit_author)
221 if match: 214 if match:
222 commit_author = match.group (1) 215 commit_author = match.group (1)
223 commit_email = match.group (2) 216 commit_email = match.group (2)
224 217
225 commit_trackeruser = find_developer_by_email (commit_email) 218 commit_trackeruser = Config.find_developer_by_email (commit_email)
226 committer = commit_trackeruser if commit_trackeruser != '' else commit_author 219 committer = commit_trackeruser if commit_trackeruser != '' else commit_author
227 220
228 for irc_client in Irc.all_clients: 221 for irc_client in Irc.all_clients:
229 for channel in irc_client.channels: 222 for channel in irc_client.channels:
230 if channel.get_value ('btprivate', False): 223 if channel.get_value ('btprivate', False):

mercurial